summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-10 16:05:21 +1000
committerJesse Duffield <jessedduffield@gmail.com>2021-04-11 17:07:49 +1000
commitbfad972f0c75bb0fb4a60cf6848c1ab205254d87 (patch)
tree3cf26baa02c0233c45db7b66e4709989ea31edbe /pkg/commands/git.go
parentbb918b579a3073d786fda83a2bc11c602e442aa0 (diff)
fix bug where mixed reset is actually a soft reset
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r--pkg/commands/git.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 2745c1935..db5585172 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -87,7 +87,13 @@ func (c *GitCommand) WithSpan(span string) *GitCommand {
newGitCommand := &GitCommand{}
*newGitCommand = *c
newGitCommand.OSCommand = c.OSCommand.WithSpan(span)
+
+ // NOTE: unlike the other things here which create shallow clones, this will
+ // actually update the PatchManager on the original struct to have the new span.
+ // This means each time we call ApplyPatch in PatchManager, we need to ensure
+ // we've called .WithSpan() ahead of time with the new span value
newGitCommand.PatchManager.ApplyPatch = newGitCommand.ApplyPatch
+
return newGitCommand
}