MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / check_git_clean

Function check_git_clean

lib/devtools/src/crewai_devtools/cli.py:149–164  ·  view source on GitHub ↗

Check if git working directory is clean. Raises: SystemExit: If there are uncommitted changes.

()

Source from the content-addressed store, hash-verified

147
148
149def check_git_clean() -> None:
150 """Check if git working directory is clean.
151
152 Raises:
153 SystemExit: If there are uncommitted changes.
154 """
155 try:
156 status = run_command(["git", "status", "--porcelain"])
157 if status:
158 console.print(
159 "[red]Error:[/red] You have uncommitted changes. Please commit or stash them first."
160 )
161 sys.exit(1)
162 except subprocess.CalledProcessError as e:
163 console.print(f"[red]Error checking git status:[/red] {e}")
164 sys.exit(1)
165
166
167def _branch_exists_local(branch: str, cwd: Path | None = None) -> bool:

Callers 2

bumpFunction · 0.85
releaseFunction · 0.85

Calls 2

run_commandFunction · 0.70
printMethod · 0.45

Tested by

no test coverage detected