diff --git a/tests/ClaudeDo.Worker.Tests/Infrastructure/GitRepoFixture.cs b/tests/ClaudeDo.Worker.Tests/Infrastructure/GitRepoFixture.cs index 89e01b02..63fa502b 100644 --- a/tests/ClaudeDo.Worker.Tests/Infrastructure/GitRepoFixture.cs +++ b/tests/ClaudeDo.Worker.Tests/Infrastructure/GitRepoFixture.cs @@ -4,12 +4,16 @@ namespace ClaudeDo.Worker.Tests.Infrastructure; public sealed class GitRepoFixture : IDisposable { + private readonly string _rootDir; + public string RepoDir { get; } public string BaseCommit { get; } public GitRepoFixture() { - RepoDir = Path.Combine(Path.GetTempPath(), $"claudedo_gittest_{Guid.NewGuid():N}"); + // Repo one level below a unique parent: the sibling worktree root (.claudedo-worktrees) is the repo's parent, so it must be unique per fixture. + _rootDir = Path.Combine(Path.GetTempPath(), $"claudedo_gittest_{Guid.NewGuid():N}"); + RepoDir = Path.Combine(_rootDir, "repo"); Directory.CreateDirectory(RepoDir); RunGit(RepoDir, "init"); @@ -28,7 +32,7 @@ public sealed class GitRepoFixture : IDisposable try { // Force-remove read-only .git objects on Windows. - ForceDeleteDirectory(RepoDir); + ForceDeleteDirectory(_rootDir); } catch { /* best effort */ } }