You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_git_toplevel misses a home-rooted repo when workspace/ is a separate mount (no GIT_DISCOVERY_ACROSS_FILESYSTEM) #2245
$start is /home/developer/workspace when that directory exists, /home/developer otherwise.
Git stops repository discovery at a filesystem boundary by default. If an agent has /home/developer/workspace as a separate mount — a bind mount, a distinct volume, an overlay — then rev-parse --show-toplevel started inside it will not walk up into /home/developer, even when the repository is genuinely rooted there.
_git_toplevel then returns None, and _detect_git_dir falls through to _detect_git_dir_fallback — the pre-#2075 content heuristic. On that topology, a populated workspace/ answers /home/developer/workspace, which is exactly the misclassification #2075 exists to eliminate. Every path-based consumer (the compatibility collector, the .gitignore migration and its .git guard, the compatibility fix endpoint) then reads and writes a subdirectory's files as if they were the repo root's.
The fallback is correct as a no-repository path. The defect is that a boundary makes a repository that does exist look like it does not.
Fix
Set GIT_DISCOVERY_ACROSS_FILESYSTEM=1 for this probe:
Safe here specifically because _git_toplevel already refuses any answer outside /home/developer — discovery may cross the boundary, but the result is still confined before it is trusted.
Provenance
Spotted in #2076, a competing implementation of the #2075 fix that carried this flag and was closed as superseded by #2077. #2077 is the better change overall (docs + a 251-line test file); this one flag is the single thing it does not have. Recorded so the idea is not lost with the closed PR.
A regression test in tests/unit/test_2075_detect_git_dir.py covers the boundary case: git answers empty/non-zero from inside workspace/ while a home-rooted repo exists, and the result is /home/developer rather than the fallback's workspace/
The containment check (answer must be /home/developer or beneath) is unchanged and still pinned by a test
Activity
fix(git): let repo discovery cross a mount boundary, so a home-rooted…
fix(git): let repo discovery cross a mount boundary, so a home-rooted…