diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-08-11 22:31:18 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-08-11 23:31:18 +0300 |
commit | e9bb75d8d18ba88dc26e4c4af6dc66812a9b8fb6 (patch) | |
tree | a4940d4ff3c8c16015a13be3c8540ec63565890b /modules/pull | |
parent | 8bfeb85f93ccd41289f901977243258e1b69f4d6 (diff) | |
download | gitea-e9bb75d8d18ba88dc26e4c4af6dc66812a9b8fb6.tar.gz gitea-e9bb75d8d18ba88dc26e4c4af6dc66812a9b8fb6.zip |
Fix duplicate call of webhook (#7821)
Diffstat (limited to 'modules/pull')
-rw-r--r-- | modules/pull/merge.go | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/modules/pull/merge.go b/modules/pull/merge.go index ed2fe48379..cf2fb7fc4f 100644 --- a/modules/pull/merge.go +++ b/modules/pull/merge.go @@ -292,39 +292,6 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor go models.HookQueue.Add(pr.Issue.Repo.ID) } - l, err := baseGitRepo.CommitsBetweenIDs(pr.MergedCommitID, pr.MergeBase) - if err != nil { - log.Error("CommitsBetweenIDs: %v", err) - return nil - } - - // It is possible that head branch is not fully sync with base branch for merge commits, - // so we need to get latest head commit and append merge commit manually - // to avoid strange diff commits produced. - mergeCommit, err := baseGitRepo.GetBranchCommit(pr.BaseBranch) - if err != nil { - log.Error("GetBranchCommit: %v", err) - return nil - } - if mergeStyle == models.MergeStyleMerge { - l.PushFront(mergeCommit) - } - - p := &api.PushPayload{ - Ref: git.BranchPrefix + pr.BaseBranch, - Before: pr.MergeBase, - After: mergeCommit.ID.String(), - CompareURL: setting.AppURL + pr.BaseRepo.ComposeCompareURL(pr.MergeBase, pr.MergedCommitID), - Commits: models.ListToPushCommits(l).ToAPIPayloadCommits(pr.BaseRepo.HTMLURL()), - Repo: pr.BaseRepo.APIFormat(mode), - Pusher: pr.HeadRepo.MustOwner().APIFormat(), - Sender: doer.APIFormat(), - } - if err = models.PrepareWebhooks(pr.BaseRepo, models.HookEventPush, p); err != nil { - log.Error("PrepareWebhooks: %v", err) - } else { - go models.HookQueue.Add(pr.BaseRepo.ID) - } return nil } |