summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-03-25 00:38:22 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-03-25 09:39:04 +1100
commit45bba0a3c58231091fd1eb95120e33ffb6ee1972 (patch)
treeb088865176e222ce491f04d4a441ae47b0bb17e0 /pkg
parentd105e2690a244543c911148bb07774a3853087eb (diff)
ignore redundant actions when undoing and redoing
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/undoing.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg/gui/undoing.go b/pkg/gui/undoing.go
index c10914e6d..c43d297ea 100644
--- a/pkg/gui/undoing.go
+++ b/pkg/gui/undoing.go
@@ -63,21 +63,23 @@ func (gui *Gui) parseReflogForActions(onUserAction func(counter int, action refl
action = &reflogAction{kind: COMMIT, from: prevCommitSha, to: reflogCommit.Sha}
} else if ok, _ := utils.FindStringSubmatch(reflogCommit.Name, `^rebase -i \(start\)`); ok {
// if we're here then we must be currently inside an interactive rebase
- action = &reflogAction{kind: CURRENT_REBASE}
+ action = &reflogAction{kind: CURRENT_REBASE, from: prevCommitSha}
}
} else if ok, _ := utils.FindStringSubmatch(reflogCommit.Name, `^rebase -i \(start\)`); ok {
action = &reflogAction{kind: REBASE, from: prevCommitSha, to: rebaseFinishCommitSha}
+ rebaseFinishCommitSha = ""
}
if action != nil {
+ if action.kind != CURRENT_REBASE && action.from == action.to {
+ // if we're going from one place to the same place we'll ignore the action.
+ continue
+ }
ok, err := onUserAction(counter, *action)
if ok {
return err
}
counter--
- if action.kind == REBASE {
- rebaseFinishCommitSha = ""
- }
}
}
return nil