summaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-09-04 19:59:19 +0100
committerGitHub <noreply@github.com>2020-09-04 14:59:19 -0400
commitbda9e51fef8d1fb5aa76e7185cd414eb893bb986 (patch)
tree9a5b20df5e9d8a351ec2cbe8f1f3e15941096219 /modules/git
parent482b0e6d478d5751407f124bda6296be084c62fa (diff)
downloadgitea-bda9e51fef8d1fb5aa76e7185cd414eb893bb986.tar.gz
gitea-bda9e51fef8d1fb5aa76e7185cd414eb893bb986.zip
Remove async pre-empt hack if go >= 1.15 (#12718)
Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/command.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/git/command.go b/modules/git/command.go
index 1496b0186e..2a00a0a203 100644
--- a/modules/git/command.go
+++ b/modules/git/command.go
@@ -11,10 +11,12 @@ import (
"io"
"os"
"os/exec"
+ "runtime"
"strings"
"time"
"code.gitea.io/gitea/modules/process"
+ "github.com/mcuadros/go-version"
)
var (
@@ -130,7 +132,9 @@ func (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time.
}
// TODO: verify if this is still needed in golang 1.15
- cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
+ if version.Compare(runtime.Version(), "go1.15", "<") {
+ cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1")
+ }
cmd.Dir = dir
cmd.Stdout = stdout
cmd.Stderr = stderr