MCPcopy Create free account
hub / github.com/FastLED/FastLED / get_porcelain

Function get_porcelain

ci/hooks/check-on-stop.py:188–206  ·  view source on GitHub ↗

Return `git status --porcelain` output, or None if the tree is clean. Raises: GitPorcelainError: if the underlying ``git status`` invocation fails. Per coding guidelines, we never silently fall back on missing critical resources; a broken Git invocation must surf

()

Source from the content-addressed store, hash-verified

186
187
188def get_porcelain() -> str | None:
189 """Return `git status --porcelain` output, or None if the tree is clean.
190
191 Raises:
192 GitPorcelainError: if the underlying ``git status`` invocation fails.
193 Per coding guidelines, we never silently fall back on missing
194 critical resources; a broken Git invocation must surface as a
195 hook failure rather than being collapsed into the clean-tree
196 "skip" path.
197 """
198 result = run_cmd(["git", "status", "--porcelain"])
199 if result.returncode != 0:
200 raise GitPorcelainError(
201 f"git status --porcelain failed (exit {result.returncode}): "
202 f"{(result.stderr or '').strip() or '(no stderr)'}"
203 )
204 if not result.stdout.strip():
205 return None
206 return result.stdout
207
208
209def get_current_fingerprint(porcelain: str | None = None) -> str | None:

Callers 2

get_current_fingerprintFunction · 0.85
mainFunction · 0.85

Calls 2

GitPorcelainErrorClass · 0.85
run_cmdFunction · 0.70

Tested by

no test coverage detected