summaryrefslogtreecommitdiffstats
path: root/services/pull/check.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-02-06 20:01:47 +0100
committerGitHub <noreply@github.com>2022-02-06 20:01:47 +0100
commit3043eb36bfcd7ddf29202b958b91942826a8182b (patch)
treef6bfcb38648f07ff8132558ff826b8b1aac003ec /services/pull/check.go
parent8ae5e6d7fdd577ebf0807bf33a4cdeef35d254d9 (diff)
downloadgitea-3043eb36bfcd7ddf29202b958b91942826a8182b.tar.gz
gitea-3043eb36bfcd7ddf29202b958b91942826a8182b.zip
Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552)
Diffstat (limited to 'services/pull/check.go')
-rw-r--r--services/pull/check.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/check.go b/services/pull/check.go
index 2203fb8749..b1e9237d11 100644
--- a/services/pull/check.go
+++ b/services/pull/check.go
@@ -92,7 +92,7 @@ func getMergeCommit(ctx context.Context, pr *models.PullRequest) (*git.Commit, e
headFile := pr.GetGitRefName()
// Check if a pull request is merged into BaseBranch
- _, err = git.NewCommandContext(ctx, "merge-base", "--is-ancestor", headFile, pr.BaseBranch).
+ _, err = git.NewCommand(ctx, "merge-base", "--is-ancestor", headFile, pr.BaseBranch).
RunInDirWithEnv(pr.BaseRepo.RepoPath(), []string{"GIT_INDEX_FILE=" + indexTmpPath, "GIT_DIR=" + pr.BaseRepo.RepoPath()})
if err != nil {
// Errors are signaled by a non-zero status that is not 1
@@ -113,7 +113,7 @@ func getMergeCommit(ctx context.Context, pr *models.PullRequest) (*git.Commit, e
cmd := commitID[:40] + ".." + pr.BaseBranch
// Get the commit from BaseBranch where the pull request got merged
- mergeCommit, err := git.NewCommandContext(ctx, "rev-list", "--ancestry-path", "--merges", "--reverse", cmd).
+ mergeCommit, err := git.NewCommand(ctx, "rev-list", "--ancestry-path", "--merges", "--reverse", cmd).
RunInDirWithEnv("", []string{"GIT_INDEX_FILE=" + indexTmpPath, "GIT_DIR=" + pr.BaseRepo.RepoPath()})
if err != nil {
return nil, fmt.Errorf("git rev-list --ancestry-path --merges --reverse: %v", err)