summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorTommy Nguyen <remyabel@gmail.com>2018-08-22 11:34:16 -0400
committerTommy Nguyen <remyabel@gmail.com>2018-08-22 11:34:16 -0400
commit110ff38c0d4a40ff450086480fe8ebe0fd2ed61d (patch)
tree38b6dcbe15b2ff49c27c71d52a75119dd487829a /pkg
parenteff931a1387dc042b77701ece91e4028bb15aeda (diff)
Remove accidentally checked in code
Diffstat (limited to 'pkg')
-rw-r--r--pkg/commands/git.go4
-rw-r--r--pkg/gui/files_panel.go23
2 files changed, 13 insertions, 14 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 65e457b6f..bf9aa6646 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -270,12 +270,12 @@ func (c *GitCommand) Pull() error {
}
// Push push to a branch
-func (c *GitCommand) Push(branchName string, force bool) (*exec.Cmd, error) {
+func (c *GitCommand) Push(branchName string, force bool) error {
forceFlag := ""
if force {
forceFlag = "--force-with-lease "
}
- return c.OSCommand.PrepareSubProcess(c.OSCommand.Platform.shell, c.OSCommand.Platform.shellArg, "git push " + forceFlag + "-u origin " + branchName)
+ return c.OSCommand.RunCommand("git push " + forceFlag + "-u origin " + branchName)
}
// SquashPreviousTwoCommits squashes a commit down to the one below it
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go
index 0b921ca0d..5791a9d15 100644
--- a/pkg/gui/files_panel.go
+++ b/pkg/gui/files_panel.go
@@ -364,18 +364,17 @@ func (gui *Gui) pushWithForceFlag(currentView *gocui.View, force bool) error {
if err := gui.createMessagePanel(gui.g, currentView, "", gui.Tr.SLocalize("PushWait")); err != nil {
return err
}
- branchName := gui.State.Branches[0].Name
- sub, err := gui.GitCommand.Push(branchName, force)
- if err != nil {
- _ = gui.createErrorPanel(gui.g, err.Error())
- }
- if sub != nil {
- gui.SubProcess = sub
- return gui.Errors.ErrSubProcess
- }
- _ = gui.closeConfirmationPrompt(gui.g)
- _ = gui.refreshStatus(gui.g)
- return gui.refreshCommits(gui.g)
+ go func() {
+ branchName := gui.State.Branches[0].Name
+ if err := gui.GitCommand.Push(branchName, force); err != nil {
+ _ = gui.createErrorPanel(gui.g, err.Error())
+ } else {
+ _ = gui.closeConfirmationPrompt(gui.g)
+ _ = gui.refreshCommits(gui.g)
+ _ = gui.refreshStatus(gui.g)
+ }
+ }()
+ return nil
}
func (gui *Gui) pushFiles(g *gocui.Gui, v *gocui.View) error {