diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-06-06 20:33:25 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-06-06 20:53:35 +1000 |
commit | 3e40369fd215b688dcbd9cbb8e9089c0d36522de (patch) | |
tree | 1b0b2510078cc105f8fac6cf2088aefdaada81fe /pkg/commands/os.go | |
parent | 0f0fda16605059ebae73d29f0e4b9b5d1455ce73 (diff) |
add GIT_OPTIONAL_LOCKS=0 env var to all commands
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r-- | pkg/commands/os.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go index 32d22ea5a..c61404c41 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -78,8 +78,9 @@ func (c *OSCommand) RunExecutable(cmd *exec.Cmd) error { // ExecutableFromString takes a string like `git status` and returns an executable command for it func (c *OSCommand) ExecutableFromString(commandStr string) *exec.Cmd { splitCmd := str.ToArgv(commandStr) - c.Log.Info(splitCmd) - return c.command(splitCmd[0], splitCmd[1:]...) + cmd := c.command(splitCmd[0], splitCmd[1:]...) + cmd.Env = append(os.Environ(), "GIT_OPTIONAL_LOCKS=0") + return cmd } // RunCommandWithOutputLive runs RunCommandWithOutputLiveWrapper @@ -201,8 +202,13 @@ func (c *OSCommand) EditFile(filename string) (*exec.Cmd, error) { } // PrepareSubProcess iniPrepareSubProcessrocess then tells the Gui to switch to it +// TODO: see if this needs to exist, given that ExecutableFromString does the same things func (c *OSCommand) PrepareSubProcess(cmdName string, commandArgs ...string) *exec.Cmd { - return c.command(cmdName, commandArgs...) + cmd := c.command(cmdName, commandArgs...) + if cmd != nil { + cmd.Env = append(os.Environ(), "GIT_OPTIONAL_LOCKS=0") + } + return cmd } // Quote wraps a message in platform-specific quotation marks |