summaryrefslogtreecommitdiffstats
path: root/pkg/gui/files_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-07 21:19:38 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-10-10 00:23:01 +1100
commit79e59d5460d838203bc79ac86c0ba529305ba2a9 (patch)
tree7a7d6c48440f02945599606494ac64424d274f58 /pkg/gui/files_panel.go
parentba4c3e5bc475a7819fd954985105073ba239bf9e (diff)
add some safe goroutines
WIP
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r--pkg/gui/files_panel.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index a413beab5..67d1a6eee 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -511,7 +511,7 @@ func (gui *Gui) pullFiles(opts PullFilesOptions) error {
mode := gui.Config.GetUserConfig().Git.Pull.Mode
- go gui.pullWithMode(mode, opts)
+ go utils.Safe(func() { gui.pullWithMode(mode, opts) })
return nil
}
@@ -551,7 +551,7 @@ func (gui *Gui) pushWithForceFlag(v *gocui.View, force bool, upstream string, ar
if err := gui.createLoaderPanel(v, gui.Tr.PushWait); err != nil {
return err
}
- go func() {
+ go utils.Safe(func() {
branchName := gui.getCheckedOutBranch().Name
err := gui.GitCommand.Push(branchName, force, upstream, args, gui.promptUserForCredential)
if err != nil && !force && strings.Contains(err.Error(), "Updates were rejected") {
@@ -571,7 +571,7 @@ func (gui *Gui) pushWithForceFlag(v *gocui.View, force bool, upstream string, ar
}
gui.handleCredentialsPopup(err)
_ = gui.refreshSidePanels(refreshOptions{mode: ASYNC})
- }()
+ })
return nil
}