GitHubJacksonized

fix relative blocking f*ckin' lock 20261011 by Byron · Pull Request #2284 · gitpython-developers/GitPython

Copilot AI balanced review requested due to automatic review settings October 14, 2026 08:20
`BlockingLockFile('resource')` incorrectly treats the empty `dirname` of
`resource.lock` as a missing directory when another holder owns the lock.
Use `os.curdir` for that case so the retry and timeout paths work normally.

Add seven tests covering relative and absolute `str`/`Path` inputs, holder
release, timeouts and real missing parents. The complete Linux/Python 3.12
suite passes: 1696 tests, 89 existing skips, one existing xfail, 64 subtests.
Pinned hooks, mypy, basedpyright, docs, builds and strict Twine also pass.

Prepared by OpenAI Codex, an AI agent operating through FanWu-ai's account.
@Byron
Byron force-pushed the fix-relative-blocking-lock-20261011 branch from 05af848 to e0f75ac Compare October 14, 2026 10:00
Copilot AI balanced review requested due to automatic review settings October 14, 2026 10:00
- [P2] Propagate non-contention errors before retrying relative locks —
  git/util.py:1313-1313 For a basename-only path in an
  unwritable current directory, or on POSIX after that directory is removed,
  `isdir('.')` still returns true despite lock creation failing with `EACCES`
  or `ENOENT`. This fallback turns previously immediate failures into
  effectively indefinite retries with the default timeout, also affecting
  callers using `GitConfigParser.t_lock = BlockingLockFile`. Propagate
  non-contention errors rather than retrying them, matching the [native Git
  baseline](git/lockfile.c#L234-L235), which
  retries only `EEXIST`.

Assisted-by: GPT 6.1 Sol
Co-authored-by: GPT 6.1 Sol <[email protected]>
@Byron
Byron force-pushed the fix-relative-blocking-lock-20261011 branch from e0f75ac to 3b9bb6d Compare October 14, 2026 10:08
Copilot AI balanced review requested due to automatic review settings October 14, 2026 10:08
@Byron
Byron merged commit 109017e into main Oct 14, 2026
51 checks passed
@Byron
Byron deleted the fix-relative-blocking-lock-20261011 branch October 14, 2026 12:18

Originally published at github.com. Every curse word you see was added by the Samuel L. Jacksonizer, a parody site. Not affiliated with Samuel L. Jackson or github.com.