diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-06-09 19:30:59 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-06-10 11:35:35 +1000 |
commit | 08174ca848650113681e8b748b3e905aa2b26749 (patch) | |
tree | db10ac4d649e4ea6116cc4f65001fa7cd3e6dc18 /branches_panel.go | |
parent | d413d4319ff959404046441130daaac379a62d26 (diff) |
Update README.md
Diffstat (limited to 'branches_panel.go')
-rw-r--r-- | branches_panel.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/branches_panel.go b/branches_panel.go index 8000da2a9..4060b670a 100644 --- a/branches_panel.go +++ b/branches_panel.go @@ -24,6 +24,16 @@ func handleForceCheckout(g *gocui.Gui, v *gocui.View) error { }, nil) } +func handleCheckoutByName(g *gocui.Gui, v *gocui.View) error { + createPromptPanel(g, v, "Branch Name:", func(g *gocui.Gui, v *gocui.View) error { + if output, err := gitCheckout(trimmedContent(v), false); err != nil { + return createErrorPanel(g, output) + } + return refreshSidePanels(g) + }) + return nil +} + func handleNewBranch(g *gocui.Gui, v *gocui.View) error { branch := state.Branches[0] createPromptPanel(g, v, "New Branch Name (Branch is off of "+branch.Name+")", func(g *gocui.Gui, v *gocui.View) error { @@ -31,7 +41,7 @@ func handleNewBranch(g *gocui.Gui, v *gocui.View) error { return createErrorPanel(g, output) } refreshSidePanels(g) - return handleCommitSelect(g, v) + return handleBranchSelect(g, v) }) return nil } @@ -59,6 +69,7 @@ func renderBranchesOptions(g *gocui.Gui) error { "space": "checkout", "f": "force checkout", "m": "merge", + "c": "checkout by name", }) } |