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

Method head_commit

lib/cli/src/crewai_cli/git.py:137–145  ·  view source on GitHub ↗

Return the short hash of HEAD, or None when there is no commit yet.

(self)

Source from the content-addressed store, hash-verified

135 return False
136
137 def head_commit(self) -> str | None:
138 """Return the short hash of HEAD, or None when there is no commit yet."""
139 result = subprocess.run(
140 ["git", "rev-parse", "--short", "--verify", "HEAD"], # noqa: S607
141 cwd=self.path,
142 capture_output=True,
143 text=True,
144 )
145 return result.stdout.strip() if result.returncode == 0 else None
146
147 def has_changes_under_path(self) -> bool | None:
148 """Return whether files under ``path`` differ from HEAD, or None if unknown.

Calls 1

runMethod · 0.45