Problem
GitRepository.FromLocalDirectory finds the repo root by looking for a .git directory (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
Notes
Increasingly relevant because AI coding agents commonly run in git worktrees for isolation. Surfaced while smoke-testing #447 from a worktree.
Problem
GitRepository.FromLocalDirectoryfinds the repo root by looking for a.gitdirectory (src/Fallout.Build/VCS/GitRepository.cs:42, viaContainsDirectory(".git")), then reads HEAD/config fromrootDirectory / ".git"(:43). In a git worktree.gitis a file containing agitdir: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.FromLocalDirectoryresolves the repo when.gitis a file (worktree), not only a directorygitdir:pointer instead of assumingrootDirectory / ".git"is a directory./build.ps1 <target>runs from a worktree without theNo parent Git directoryfailureGitHubTasksSpecs.GitHubRepositoryFromLocalDirectorySpecandChangelogTasksSpecs.Missing_changelog_does_not_add_a_full_changelog_link_to_release_notespass when the suite runs from a worktreeNotes
Increasingly relevant because AI coding agents commonly run in git worktrees for isolation. Surfaced while smoke-testing #447 from a worktree.