From 5050413d09b9674224a315433220ee0e240e7b58 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Fri, 12 Aug 2022 16:02:36 -0700 Subject: [PATCH] Reset --soft in the root Using --hard checks out all the files. Not resetting fails tests. --- cmd/git-sync/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 }