diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-22 11:57:44 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | 442f6cd854d972c3797ca203c8de6943fe81d2ca (patch) | |
tree | bd4b60dce12233f2bc15111efd7c473b58005b39 /pkg/gui/cherry_picking.go | |
parent | c2b154acad4e1040bdc0e09cf44733ccd877923b (diff) |
more cherry picking stuff, mostly around the reflog
Diffstat (limited to 'pkg/gui/cherry_picking.go')
-rw-r--r-- | pkg/gui/cherry_picking.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pkg/gui/cherry_picking.go b/pkg/gui/cherry_picking.go index bd0ee5007..e683d0f3f 100644 --- a/pkg/gui/cherry_picking.go +++ b/pkg/gui/cherry_picking.go @@ -55,7 +55,7 @@ func (gui *Gui) handleCopyCommit() error { return context.HandleRender() } -func (gui *Gui) CherryPickedCommitShaMap() map[string]bool { +func (gui *Gui) cherryPickedCommitShaMap() map[string]bool { commitShaMap := map[string]bool{} for _, commit := range gui.State.Modes.CherryPicking.CherryPickedCommits { commitShaMap[commit.Sha] = true @@ -84,7 +84,7 @@ func (gui *Gui) commitsListForContext() []*commands.Commit { } func (gui *Gui) addCommitToCherryPickedCommits(index int) { - commitShaMap := gui.CherryPickedCommitShaMap() + commitShaMap := gui.cherryPickedCommitShaMap() commitsList := gui.commitsListForContext() commitShaMap[commitsList[index].Sha] = true @@ -110,7 +110,9 @@ func (gui *Gui) handleCopyCommitRange() error { return nil } - gui.resetCherryPickingIfNecessary(context) + if err := gui.resetCherryPickingIfNecessary(context); err != nil { + return err + } commit, ok := context.SelectedItem().(*commands.Commit) if !ok { @@ -120,7 +122,7 @@ func (gui *Gui) handleCopyCommitRange() error { return nil } - commitShaMap := gui.CherryPickedCommitShaMap() + commitShaMap := gui.cherryPickedCommitShaMap() // find the last commit that is copied that's above our position // if there are none, startIndex = 0 @@ -135,7 +137,7 @@ func (gui *Gui) handleCopyCommitRange() error { gui.addCommitToCherryPickedCommits(index) } - return gui.Contexts.BranchCommits.Context.HandleRender() + return context.HandleRender() } // HandlePasteCommits begins a cherry-pick rebase with the commits the user has copied |