From 6df62b4c68060d3c6c308b71efdbdc675aea8d2e Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Fri, 11 Sep 2026 11:36:29 +0200 Subject: [PATCH] Compare a linked worktree's path the way git spells it 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 --- tests/Stampeded.Core.Tests/GitRebaseTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Stampeded.Core.Tests/GitRebaseTests.cs b/tests/Stampeded.Core.Tests/GitRebaseTests.cs index ae724b9..116d7dd 100644 --- a/tests/Stampeded.Core.Tests/GitRebaseTests.cs +++ b/tests/Stampeded.Core.Tests/GitRebaseTests.cs @@ -316,6 +316,7 @@ public async Task TheStateIsFoundInALinkedWorktreeWithoutAskingGit() // repository with forty worktrees would otherwise cost forty processes per check. string other = NewDirectory(); await Git(repo, "worktree", "add", "--quiet", other, "topic"); + string otherAsGitReportsIt = await AsGitReports(other); var git = new GitService(repo); Assert.That(await git.InProgressInAsync(other), Is.Null); @@ -329,8 +330,8 @@ public async Task TheStateIsFoundInALinkedWorktreeWithoutAskingGit() Assert.That(await git.InProgressInAsync(other), Is.EqualTo(GitOperation.Rebase)); var found = await git.ListInProgressAsync(); - Assert.That(found.Select(o => o.WorkingDirectory), Does.Contain(other)); - Assert.That(found.Single(o => o.WorkingDirectory == other).Branch, Is.EqualTo("wt-topic"), + Assert.That(found.Select(o => o.WorkingDirectory), Does.Contain(otherAsGitReportsIt)); + Assert.That(found.Single(o => o.WorkingDirectory == otherAsGitReportsIt).Branch, Is.EqualTo("wt-topic"), "the branch is read from the rebase state, since the worktree is detached while it runs"); await Git(other, "rebase", "--abort");