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

Function check_git_clean

lib/devtools/src/crewai_devtools/cli.py:147–162  ·  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

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