diff options
author | Martin Scholz <martin.scholz83@outlook.com> | 2022-02-11 13:47:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 13:47:22 +0100 |
commit | 26718a785ac49f17eab51ad0f5324d036b810f73 (patch) | |
tree | 9c8371e01460dacf8e65c88b3526e2123525c717 /services/pull/patch.go | |
parent | 393ea86ae192325e45d7fac0fc6a277da8fb0fca (diff) | |
download | gitea-26718a785ac49f17eab51ad0f5324d036b810f73.tar.gz gitea-26718a785ac49f17eab51ad0f5324d036b810f73.zip |
Change git.cmd to RunWithContext (#18693)
Change all `cmd...Pipeline` commands to `cmd.RunWithContext`.
#18553
Co-authored-by: Martin Scholz <martin.scholz@versasec.com>
Diffstat (limited to 'services/pull/patch.go')
-rw-r--r-- | services/pull/patch.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/services/pull/patch.go b/services/pull/patch.go index a2c8345326..f401b85345 100644 --- a/services/pull/patch.go +++ b/services/pull/patch.go @@ -383,10 +383,11 @@ func checkConflicts(ctx context.Context, pr *models.PullRequest, gitRepo *git.Re // 7. Run the check command conflict = false err = git.NewCommand(gitRepo.Ctx, args...). - RunInDirTimeoutEnvFullPipelineFunc( - nil, -1, tmpBasePath, - nil, stderrWriter, nil, - func(ctx context.Context, cancel context.CancelFunc) error { + RunWithContext(&git.RunContext{ + Timeout: -1, + Dir: tmpBasePath, + Stderr: stderrWriter, + PipelineFunc: func(ctx context.Context, cancel context.CancelFunc) error { // Close the writer end of the pipe to begin processing _ = stderrWriter.Close() defer func() { @@ -444,7 +445,8 @@ func checkConflicts(ctx context.Context, pr *models.PullRequest, gitRepo *git.Re } return nil - }) + }, + }) // 8. If there is a conflict the `git apply` command will return a non-zero error code - so there will be a positive error. if err != nil { |