From 301e5e3711b64e671ea154aef73d4ccaa44963f3 Mon Sep 17 00:00:00 2001 From: Anthony Eid Date: Mon, 6 Apr 2026 15:48:27 -0400 Subject: [PATCH] Don't update HEAD ref in fake repo when creating detached worktree This goes against what git does internally and could cause testing bugs in the future --- crates/fs/src/fake_git_repo.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/fs/src/fake_git_repo.rs b/crates/fs/src/fake_git_repo.rs index 419bf1c682b82f5509a20c91d55b04a8248ffd20..62e6522af98ae6508db355c699559d457056a7e1 100644 --- a/crates/fs/src/fake_git_repo.rs +++ b/crates/fs/src/fake_git_repo.rs @@ -610,8 +610,6 @@ impl GitRepository for FakeGitRepository { let ref_name = format!("refs/heads/{branch_name}"); state.refs.insert(ref_name, sha); state.branches.insert(branch_name); - } else { - state.refs.insert("HEAD".into(), sha); } Ok::<(), anyhow::Error>(()) })??;