summaryrefslogtreecommitdiffstats
path: root/pkg/gui/patch_options_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-21 20:54:09 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commitf3c87bde889ca6c88bf50a97e5aa362ec713ef0b (patch)
treec873468197180a184e1bb8a77f24a7fd297c856e /pkg/gui/patch_options_panel.go
parent3f7136fc7dd231a96be051c4887bc75bfbf08de4 (diff)
more
Diffstat (limited to 'pkg/gui/patch_options_panel.go')
-rw-r--r--pkg/gui/patch_options_panel.go30
1 files changed, 16 insertions, 14 deletions
diff --git a/pkg/gui/patch_options_panel.go b/pkg/gui/patch_options_panel.go
index 7d71e1fb2..32717b8e1 100644
--- a/pkg/gui/patch_options_panel.go
+++ b/pkg/gui/patch_options_panel.go
@@ -46,20 +46,22 @@ func (gui *Gui) handleCreatePatchOptionsMenu(g *gocui.Gui, v *gocui.View) error
},
}...)
- selectedCommit := gui.getSelectedCommit()
- if selectedCommit != nil && gui.GitCommand.PatchManager.Parent != selectedCommit.Sha {
- // adding this option to index 1
- menuItems = append(
- menuItems[:1],
- append(
- []*menuItem{
- {
- displayString: fmt.Sprintf("move patch to selected commit (%s)", selectedCommit.Sha),
- onPress: gui.handleMovePatchToSelectedCommit,
- },
- }, menuItems[1:]...,
- )...,
- )
+ if gui.currentContext() == gui.Contexts.BranchCommits.Context {
+ selectedCommit := gui.getSelectedCommit()
+ if selectedCommit != nil && gui.GitCommand.PatchManager.Parent != selectedCommit.Sha {
+ // adding this option to index 1
+ menuItems = append(
+ menuItems[:1],
+ append(
+ []*menuItem{
+ {
+ displayString: fmt.Sprintf("move patch to selected commit (%s)", selectedCommit.Sha),
+ onPress: gui.handleMovePatchToSelectedCommit,
+ },
+ }, menuItems[1:]...,
+ )...,
+ )
+ }
}
}