diff options
Diffstat (limited to 'services/agit/agit.go')
-rw-r--r-- | services/agit/agit.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/agit/agit.go b/services/agit/agit.go index 34f097b42d..eae20a8187 100644 --- a/services/agit/agit.go +++ b/services/agit/agit.go @@ -156,7 +156,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat Flow: models.PullRequestFlowAGit, } - if err := pull_service.NewPullRequest(repo, prIssue, []int64{}, []string{}, pr, []int64{}); err != nil { + if err := pull_service.NewPullRequest(ctx, repo, prIssue, []int64{}, []string{}, pr, []int64{}); err != nil { if models.IsErrUserDoesNotHaveAccessToRepo(err) { ctx.Error(http.StatusBadRequest, "UserDoesNotHaveAccessToRepo", err.Error()) return nil @@ -205,7 +205,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat } if !forcePush { - output, err := git.NewCommand("rev-list", "--max-count=1", oldCommitID, "^"+opts.NewCommitIDs[i]).RunInDirWithEnv(repo.RepoPath(), os.Environ()) + output, err := git.NewCommandContext(ctx, "rev-list", "--max-count=1", oldCommitID, "^"+opts.NewCommitIDs[i]).RunInDirWithEnv(repo.RepoPath(), os.Environ()) if err != nil { log.Error("Unable to detect force push between: %s and %s in %-v Error: %v", oldCommitID, opts.NewCommitIDs[i], repo, err) ctx.JSON(http.StatusInternalServerError, private.Response{ @@ -224,7 +224,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat } pr.HeadCommitID = opts.NewCommitIDs[i] - if err = pull_service.UpdateRef(pr); err != nil { + if err = pull_service.UpdateRef(ctx, pr); err != nil { log.Error("Failed to update pull ref. Error: %v", err) ctx.JSON(http.StatusInternalServerError, map[string]interface{}{ "Err": fmt.Sprintf("Failed to update pull ref. Error: %v", err), @@ -249,7 +249,7 @@ func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []privat }) return nil } - comment, err := models.CreatePushPullComment(pusher, pr, oldCommitID, opts.NewCommitIDs[i]) + comment, err := models.CreatePushPullComment(ctx, pusher, pr, oldCommitID, opts.NewCommitIDs[i]) if err == nil && comment != nil { notification.NotifyPullRequestPushCommits(pusher, pr, comment) } |