1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-25 00:46:54 +02:00

genericise creating new branches off things

This commit is contained in:
Jesse Duffield
2020-08-22 09:55:49 +10:00
parent f858c8e750
commit f63ec38aae
6 changed files with 71 additions and 75 deletions

View File

@ -221,22 +221,6 @@ func (gui *Gui) getCheckedOutBranch() *commands.Branch {
return gui.State.Branches[0]
}
func (gui *Gui) handleNewBranch(g *gocui.Gui, v *gocui.View) error {
branch := gui.getSelectedBranch()
if branch == nil {
return nil
}
message := gui.Tr.TemplateLocalize(
"NewBranchNameBranchOff",
Teml{
"branchName": branch.Name,
},
)
return gui.prompt(v, message, "", func(response string) error {
return gui.createNewBranchWithName(response)
})
}
func (gui *Gui) createNewBranchWithName(newBranchName string) error {
branch := gui.getSelectedBranch()
if branch == nil {