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

Function warn_stale_worktrees

ci/hooks/check-on-stop.py:298–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

296
297
298def warn_stale_worktrees() -> None:
299 try:
300 n = count_stale_worktrees()
301 except KeyboardInterrupt:
302 import _thread
303
304 _thread.interrupt_main()
305 raise
306 except OSError as exc:
307 # Don't crash the stop hook on a directory-scan failure, but do
308 # surface the descriptive error so it isn't silently swallowed.
309 print(f"warn_stale_worktrees: {exc}", file=sys.stderr)
310 return
311 if n > STALE_WORKTREE_THRESHOLD:
312 print(
313 f"Note: {n} stale agent worktrees in .claude/worktrees/, "
314 "run `bash clean-worktrees` to reclaim space",
315 file=sys.stderr,
316 )
317
318
319def _fmt_seconds(seconds: float) -> str:

Callers 1

mainFunction · 0.85

Calls 2

count_stale_worktreesFunction · 0.85
printFunction · 0.50

Tested by

no test coverage detected