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
Project root lookup accepts any .git, including an empty directory git rejects #120
project_root (crates/icx-adapters/src/workspace.rs:120) takes the nearest ancestor where <dir>/.git exists. It does not check that the .git is a repository git would accept, so an
empty or partial .git directory captures every directory beneath it into one icx workspace.
Found on PR #119: a stray, empty /tmp/.git (owner unknown) made git say "not a git repository"
for everything under /tmp, while icx resolved every test project under /tmp to /tmp. As a
result proxy_routes_each_project_into_its_own_workspace (crates/icx-cli/tests/proxy_projects.rs:244)
failed on unmodified main (fb7029e): project A's workspace gained a second artifact between its
first and fourth requests, so its folded history was no longer byte-identical. With TMPDIR
outside /tmp it passed; after rmdir /tmp/.git the original run also passes. CI did not see it.
Effects outside tests: a .git left in a parent directory (an aborted clone, a planted or empty
directory in a shared location) merges unrelated projects' recall, folded outputs and proxy cache
ledgers into one workspace, which is the cross-project boundary #117 established.
Proposed fix
Accept .git only when it matches git's own discovery rules:
a directory with HEAD, an objects directory and a refs directory (git's is_git_directory);
a file whose gitdir: line names such a directory, which keeps the existing linked-worktree
check in worktree_main_root.
Skip a .git that fails the check and continue to the next ancestor, matching git. Add a test
with an empty .git directory above a real repository, and one above a plain directory.
Optional: make proxy_projects.rs independent of the host /tmp by giving each test project its
own git init, so a stray ancestor cannot change which workspace it resolves to.
Fixed in #119 (squash acdcbb5): project root lookup follows git's discovery rules, with bounded non-blocking control-file reads; regression tests assert each case against git rev-parse.
Activity
fix(workspace): find the project root as git does (#120)
fix(workspace): bounded, non-blocking reads of git control files
doublegate commentedon Nov 28, 2026
Fixed in #119 (squash acdcbb5): project root lookup follows git's discovery rules, with bounded non-blocking control-file reads; regression tests assert each case against
git rev-parse.