Reset --soft in the root

Using --hard checks out all the files.  Not resetting fails tests.
This commit is contained in:
Tim Hockin 2022-08-12 16:02:36 -07:00
parent bc865d0329
commit 5050413d09
1 changed files with 2 additions and 1 deletions

View File

@ -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
}