diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-10-23 09:43:25 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-23 09:43:25 +1100 |
commit | 467775fc1ca1630ca5c1b4bdb2bc87d53c4e72c6 (patch) | |
tree | f0af2140c32532d23a84d4adcd79217ccca1bd6b /pkg/gui | |
parent | 3a23cb87b70ebb3c7c82be77a264a0b3499d76c0 (diff) | |
parent | 3b6b68a2a1541fe26b39cba676b039f72142a28b (diff) |
Merge branch 'master' into master
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/branches_panel.go | 11 | ||||
-rw-r--r-- | pkg/gui/keybindings.go | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 5c33156be..dbf4b007a 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -22,6 +22,17 @@ func (gui *Gui) handleBranchPress(g *gocui.Gui, v *gocui.View) error { return gui.refreshSidePanels(g) } +func (gui *Gui) handleCreatePullRequestPress(g *gocui.Gui, v *gocui.View) error { + branch := gui.getSelectedBranch(gui.getBranchesView(g)) + pullRequest := commands.NewPullRequest(gui.GitCommand) + + if err := pullRequest.Create(branch); err != nil { + return gui.createErrorPanel(g, err.Error()) + } + + return nil +} + func (gui *Gui) handleForceCheckout(g *gocui.Gui, v *gocui.View) error { branch := gui.getSelectedBranch(v) message := gui.Tr.SLocalize("SureForceCheckout") diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 4eea64303..8d07429a6 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -279,6 +279,12 @@ func (gui *Gui) GetKeybindings() []*Binding { Description: gui.Tr.SLocalize("checkout"), }, { ViewName: "branches", + Key: 'o', + Modifier: gocui.ModNone, + Handler: gui.handleCreatePullRequestPress, + Description: gui.Tr.SLocalize("createPullRequest"), + }, { + ViewName: "branches", Key: 'c', Modifier: gocui.ModNone, Handler: gui.handleCheckoutByName, |