diff --git a/cmd/git-sync/main.go b/cmd/git-sync/main.go index 0ee35bc..fd8a10e 100644 --- a/cmd/git-sync/main.go +++ b/cmd/git-sync/main.go @@ -1111,7 +1111,8 @@ func (git *repoSync) AddWorktreeAndSwap(ctx context.Context, hash string) error } // Reset the root's rev (so we can prune and so we can rely on it later). - _, err = git.run.Run(ctx, git.root, nil, git.cmd, "reset", "--hard", hash, "--") + // Use --soft so we do not check out files into the root. + _, err = git.run.Run(ctx, git.root, nil, git.cmd, "reset", "--soft", hash, "--") if err != nil { return err }