diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-27 21:15:12 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-27 21:25:04 +1100 |
commit | bed185eb2862b50385857299b2918d951be85413 (patch) | |
tree | ed238b1413dbb2beb2bd94b304cc9f3a3138ace3 | |
parent | 84a19920559f940b391ab3f19686e2e85039e083 (diff) |
stop retrying due to index lock for now
-rw-r--r-- | pkg/commands/git_cmd_obj_runner.go | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/pkg/commands/git_cmd_obj_runner.go b/pkg/commands/git_cmd_obj_runner.go index 8e5f5f2a4..c57c2d2be 100644 --- a/pkg/commands/git_cmd_obj_runner.go +++ b/pkg/commands/git_cmd_obj_runner.go @@ -1,9 +1,6 @@ package commands import ( - "strings" - "time" - "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/sirupsen/logrus" ) @@ -21,27 +18,7 @@ func (self *gitCmdObjRunner) Run(cmdObj oscommands.ICmdObj) error { } func (self *gitCmdObjRunner) RunWithOutput(cmdObj oscommands.ICmdObj) (string, error) { - // TODO: have this retry logic in other places we run the command - waitTime := 50 * time.Millisecond - retryCount := 5 - attempt := 0 - - for { - output, err := self.innerRunner.RunWithOutput(cmdObj) - if err != nil { - // if we have an error based on the index lock, we should wait a bit and then retry - if strings.Contains(output, ".git/index.lock") { - self.log.Error(output) - self.log.Info("index.lock prevented command from running. Retrying command after a small wait") - attempt++ - time.Sleep(waitTime) - if attempt < retryCount { - continue - } - } - } - return output, err - } + return self.innerRunner.RunWithOutput(cmdObj) } func (self *gitCmdObjRunner) RunAndProcessLines(cmdObj oscommands.ICmdObj, onLine func(line string) (bool, error)) error { |