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
[GitRepository] injection fails inside a git worktree (.git is a file, not a directory) #458
GitRepository.FromLocalDirectory finds the repo root by looking for a .gitdirectory (src/Fallout.Build/VCS/GitRepository.cs:42, via ContainsDirectory(".git")), then reads HEAD/config from rootDirectory / ".git" (:43). In a git worktree .git is a file containing a gitdir: pointer to the main repo's worktree metadata, so detection fails: No parent Git directory for '<path>'. Both ./build.ps1 (dogfood [GitRepository] injection) and any test that resolves the local repo break when run from a worktree.
Outcome
[GitRepository] injection and local-repo resolution work inside a git worktree, the same as in a normal clone.
Acceptance criteria
GitRepository.FromLocalDirectory resolves the repo when .git is a file (worktree), not only a directory
HEAD / commit / config reads follow the worktree's gitdir: pointer instead of assuming rootDirectory / ".git" is a directory
./build.ps1 <target> runs from a worktree without the No parent Git directory failure
GitHubTasksSpecs.GitHubRepositoryFromLocalDirectorySpec and ChangelogTasksSpecs.Missing_changelog_does_not_add_a_full_changelog_link_to_release_notes pass when the suite runs from a worktree
Notes
Increasingly relevant because AI coding agents commonly run in git worktrees for isolation. Surfaced while smoke-testing #447 from a worktree.
Activity
ITaluone commentedon Jul 1, 2026
I asked the author @akirayamamoto (nuke-build/nuke#1148) to open this against this fork.. let's see...
akirayamamoto commentedon Jul 2, 2026
@ITaluone feel free to open that PR agains this fork. We don't have plans to use Fallout atm.