summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorMark Kopenga <mkopenga@gmail.com>2018-10-23 13:52:50 +0200
committerGitHub <noreply@github.com>2018-10-23 13:52:50 +0200
commit1fedda6a752133cb74ddd75c7c8a839835369f92 (patch)
tree0681e80d64dd2764595b445b8f22ac0bbf7e5bed /pkg/gui
parentac03665df34e8be89672fb98e202b182d745fdaf (diff)
parent3b6b68a2a1541fe26b39cba676b039f72142a28b (diff)
Merge branch 'master' into https-ask-for-username-password
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/branches_panel.go11
-rw-r--r--pkg/gui/keybindings.go6
2 files changed, 17 insertions, 0 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go
index 0f66533b1..11a4a0ebb 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 a30dba5f4..4a8995d5f 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,