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

Function check_git_clean

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

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