summaryrefslogtreecommitdiffstats
path: root/pkg/gui/patch_options_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-21 20:31:21 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commite6a1bd656620d2b786266b593b197721d669085a (patch)
tree1c515c9856ad0e4bcbf3a66ba09c09e22e0d7c0d /pkg/gui/patch_options_panel.go
parent609f3f4bfaa71e0d94eac845ee0f8f6ffcf2e624 (diff)
generalise patch building stuff
Diffstat (limited to 'pkg/gui/patch_options_panel.go')
-rw-r--r--pkg/gui/patch_options_panel.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/patch_options_panel.go b/pkg/gui/patch_options_panel.go
index bb9bf7918..844ecbd36 100644
--- a/pkg/gui/patch_options_panel.go
+++ b/pkg/gui/patch_options_panel.go
@@ -7,13 +7,13 @@ import (
)
func (gui *Gui) handleCreatePatchOptionsMenu(g *gocui.Gui, v *gocui.View) error {
- if !gui.GitCommand.PatchManager.CommitSelected() {
+ if !gui.GitCommand.PatchManager.Active() {
return gui.createErrorPanel(gui.Tr.SLocalize("NoPatchError"))
}
menuItems := []*menuItem{
{
- displayString: fmt.Sprintf("remove patch from original commit (%s)", gui.GitCommand.PatchManager.CommitSha),
+ displayString: fmt.Sprintf("remove patch from original commit (%s)", gui.GitCommand.PatchManager.Parent),
onPress: gui.handleDeletePatchFromCommit,
},
{
@@ -39,7 +39,7 @@ func (gui *Gui) handleCreatePatchOptionsMenu(g *gocui.Gui, v *gocui.View) error
}
selectedCommit := gui.getSelectedCommit()
- if selectedCommit != nil && gui.GitCommand.PatchManager.CommitSha != selectedCommit.Sha {
+ if selectedCommit != nil && gui.GitCommand.PatchManager.Parent != selectedCommit.Sha {
// adding this option to index 1
menuItems = append(
menuItems[:1],
@@ -59,7 +59,7 @@ func (gui *Gui) handleCreatePatchOptionsMenu(g *gocui.Gui, v *gocui.View) error
func (gui *Gui) getPatchCommitIndex() int {
for index, commit := range gui.State.Commits {
- if commit.Sha == gui.GitCommand.PatchManager.CommitSha {
+ if commit.Sha == gui.GitCommand.PatchManager.Parent {
return index
}
}