mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-27 22:38:09 +02:00
safer getting of branch
This commit is contained in:
@@ -423,8 +423,13 @@ func (gui *Gui) handlePullFiles(g *gocui.Gui, v *gocui.View) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we have no upstream branch we need to set that first
|
|
||||||
currentBranch := gui.currentBranch()
|
currentBranch := gui.currentBranch()
|
||||||
|
if currentBranch == nil {
|
||||||
|
// need to wait for branches to refresh
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we have no upstream branch we need to set that first
|
||||||
if currentBranch.Pullables == "?" {
|
if currentBranch.Pullables == "?" {
|
||||||
// see if we have this branch in our config with an upstream
|
// see if we have this branch in our config with an upstream
|
||||||
conf, err := gui.GitCommand.Repo.Config()
|
conf, err := gui.GitCommand.Repo.Config()
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ func (gui *Gui) handleStatusClick(g *gocui.Gui, v *gocui.View) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
currentBranch := gui.currentBranch()
|
currentBranch := gui.currentBranch()
|
||||||
|
if currentBranch == nil {
|
||||||
|
// need to wait for branches to refresh
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
if err := gui.switchContext(gui.Contexts.Status.Context); err != nil {
|
if err := gui.switchContext(gui.Contexts.Status.Context); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user