Compare a linked worktree's path the way git spells it - #12
Merged
Conversation
TheStateIsFoundInALinkedWorktreeWithoutAskingGit failed on Windows and macOS since it arrived, while Ubuntu stayed green. ListInProgressAsync reports a checkout's directory as git worktree list prints it, and git has a spelling of its own: forward slashes on Windows, and on macOS the symlink-resolved realpath, so a temp directory under /var comes back under /private/var. The test compared that against the path it had built with Path.GetTempPath, which only agrees on Linux. The fixture already has AsGitReports for exactly this, and the sibling test of a rebase in a linked worktree uses it. Nothing in the product compares these paths for equality - they are a process working directory or a line on screen, and git takes its own spelling back - so the service keeps passing the path on unchanged and the test asks git for the expected form. Assisted-by: Claude:claude-fable-5-1:Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every
mainbuild since 522221a fails onwindows-latestandmacos-latestwhileubuntu-latestpasses (runs 34570890307, 34581216928, 34581255189). The build itself succeeds everywhere; one test fails indotnet test:Root cause.
ListInProgressAsyncreports a checkout's directory asgit worktree list --porcelainprints it, and git has a spelling of its own: forward slashes on Windows, and the symlink-resolved realpath on macOS, where the temp directory under/varis really/private/var. The test compared that against the path it had built withPath.GetTempPath(), which only agrees on Linux.Fix. The fixture already has
AsGitReportsfor exactly this, and the sibling testRebasesABranchThatIsCheckedOutInAWorktreeuses it. This test now does too. No product change: nothing insrc/compares these paths for equality (they are a process working directory or a line on screen, and git accepts its own spelling back), and normalising in .NET would not resolve the macOS symlink anyway.Verified locally on Windows: red with the forward-slash mismatch before, green after (the only remaining local failure is
DoesNotFollowASymlinkOutOfTheWorktree, which needs symlink privilege and fails before 522221a as well). The macOS case is covered by the CI matrix on this PR.🤖 Generated with Claude Code