diff options
author | Kristijan Husak <husakkristijan@gmail.com> | 2018-10-12 14:06:03 +0200 |
---|---|---|
committer | Kristijan Husak <husakkristijan@gmail.com> | 2018-10-13 22:54:51 +0200 |
commit | df0e3e52fea02950d78af5233a859f592092d475 (patch) | |
tree | 7210a491186833ca2d0481b2602add1dfa0d5e15 /pkg/gui/branches_panel.go | |
parent | d5f64602a8e10ab5c8162140d426ce677fe884ee (diff) |
Add option to create pull request form branches panel.
Diffstat (limited to 'pkg/gui/branches_panel.go')
-rw-r--r-- | pkg/gui/branches_panel.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 0f66533b1..b4ba151b5 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") |