1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-23 12:18:51 +02:00

add waiting status to checkout ref handler

This commit is contained in:
Jesse Duffield 2020-03-21 12:49:12 +11:00
parent 65917272a2
commit 7c8df28d01

View File

@ -155,6 +155,7 @@ func (gui *Gui) handleCheckoutRef(ref string, options handleCheckoutRefOptions)
waitingStatus = gui.Tr.SLocalize("CheckingOutStatus") waitingStatus = gui.Tr.SLocalize("CheckingOutStatus")
} }
return gui.WithWaitingStatus(waitingStatus, func() error {
if err := gui.GitCommand.Checkout(ref, false); err != nil { if err := gui.GitCommand.Checkout(ref, false); err != nil {
// note, this will only work for english-language git commands. If we force git to use english, and the error isn't this one, then the user will receive an english command they may not understand. I'm not sure what the best solution to this is. Running the command once in english and a second time in the native language is one option // note, this will only work for english-language git commands. If we force git to use english, and the error isn't this one, then the user will receive an english command they may not understand. I'm not sure what the best solution to this is. Running the command once in english and a second time in the native language is one option
@ -197,6 +198,7 @@ func (gui *Gui) handleCheckoutRef(ref string, options handleCheckoutRefOptions)
gui.State.Panels.Branches.SelectedLine = 0 gui.State.Panels.Branches.SelectedLine = 0
gui.State.Panels.Commits.SelectedLine = 0 gui.State.Panels.Commits.SelectedLine = 0
return gui.refreshSidePanels(gui.g) return gui.refreshSidePanels(gui.g)
})
} }
func (gui *Gui) handleCheckoutByName(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleCheckoutByName(g *gocui.Gui, v *gocui.View) error {