Expand description
Git lock utilities for detecting and cleaning stale locks
Functionsยง
- clean_
stale_ index_ lock - Detect and remove stale Git index lock if safe to do so Returns true if a stale lock was removed
- is_
lock_ error - Check if an error is a Git lock error
- retry_
on_ lock - Retry an operation that returns CascadeError on index lock contention. Uses exponential backoff with the same timing as with_lock_retry.
- wait_
for_ index_ lock - Wait for the git index lock to be released before starting a destructive operation. Polls the filesystem for the lock file to disappear. IDE locks are transient (milliseconds for a status check), so a short timeout catches the common case. Falls back to stale lock cleanup if the lock persists past the timeout.
- with_
lock_ retry - Execute a git2 operation with exponential-backoff retry on index lock contention. Retries up to 4 times with delays of 50ms, 100ms, 200ms before falling back to stale lock cleanup as a last resort.