summaryrefslogtreecommitdiffstats
path: root/pkg/gui/files_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-23 17:28:28 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 17:49:58 +1000
commit364bdcf53211b5e4709f5e69cbd3c909c6fb79ee (patch)
treeeb53c285f4c2e9febad561261f6e20082d9bc951 /pkg/gui/files_panel.go
parentba7e09837399dd81c40ad74c0f2ee9fa8f8a368d (diff)
safer getting of branch
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r--pkg/gui/files_panel.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index a8aa02436..c4798c854 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -423,8 +423,13 @@ func (gui *Gui) handlePullFiles(g *gocui.Gui, v *gocui.View) error {
return nil
}
- // if we have no upstream branch we need to set that first
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 == "?" {
// see if we have this branch in our config with an upstream
conf, err := gui.GitCommand.Repo.Config()