Skip to content

Commit d67ffa9

Browse files
EliahKaganclaude
andcommitted
Fix stale path in _tc_lock_fpaths
`_tc_lock_fpaths` was written for a `test_repo.py` that lived two directory levels deep under the repo root, at `git/test/test_repo.py`. After the tests directory was moved up to `test/` in 0374d7c (2020-07-12, "tests: move to root dir"; see also d5f0d48 for the related revert that landed alongside it), `__file__` is one level shallower, and the `../../.git/*.lock` glob pattern resolves to `<parent-of-repo>/.git/*.lock` -- not the repository's own `.git/`. That directory typically does not exist on CI runners or in normal development setups, so `glob.glob(...)` has been returning `[]` and `_rm_lock_files` has been a silent no-op for several years. Change the relative-path miscount to match the current depth. The previous commit added a regression test (now passing with this change) that creates a `.lock` file in the repository's `.git/` and asserts `_rm_lock_files()` removes it. That test fails without this one-line correction. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 41342f0 commit d67ffa9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎test/test_repo.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def flatten(lol):
5454
return list(iter_flatten(lol))
5555

5656

57-
_tc_lock_fpaths = osp.join(osp.dirname(__file__), "../../.git/*.lock")
57+
_tc_lock_fpaths = osp.join(osp.dirname(__file__), "../.git/*.lock")
5858

5959

6060
def _rm_lock_files():

0 commit comments

Comments
 (0)