Skip to content

Compare a linked worktree's path the way git spells it - #12

Merged
siegfriedpammer merged 1 commit into
mainfrom
fix/worktree-path-as-git-spells-it
Sep 11, 2026
Merged

Compare a linked worktree's path the way git spells it#12
siegfriedpammer merged 1 commit into
mainfrom
fix/worktree-path-as-git-spells-it

Conversation

@christophwille

Copy link
Copy Markdown
Member

Every main build since 522221a fails on windows-latest and macos-latest while ubuntu-latest passes (runs 34570890307, 34581216928, 34581255189). The build itself succeeds everywhere; one test fails in dotnet test:

GitRebaseTests.TheStateIsFoundInALinkedWorktreeWithoutAskingGit
  Windows  Expected: C:\Users\runneradmin\AppData\Local\Temp\stampeded-test-811d547c
           But was:  C:/Users/runneradmin/AppData/Local/Temp/stampeded-test-811d547c
  macOS    Expected: /var/folders/.../T/stampeded-test-27c7c42a
           But was:  /private/var/folders/.../T/stampeded-test-27c7c42a

Root cause. ListInProgressAsync reports a checkout's directory as git worktree list --porcelain prints 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 /var is really /private/var. The test compared that against the path it had built with Path.GetTempPath(), which only agrees on Linux.

Fix. The fixture already has AsGitReports for exactly this, and the sibling test RebasesABranchThatIsCheckedOutInAWorktree uses it. This test now does too. No product change: nothing in src/ 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

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
@siegfriedpammer
siegfriedpammer merged commit 579cbd8 into main Sep 11, 2026
3 checks passed
@siegfriedpammer
siegfriedpammer deleted the fix/worktree-path-as-git-spells-it branch September 11, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants