summaryrefslogtreecommitdiffstats
path: root/models/pull.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-14 04:17:26 -0700
committerUnknwon <u@gogs.io>2016-08-14 04:17:26 -0700
commitdccb0c15b996ac4dc0307cbfed140ce1558d7e3c (patch)
tree97593eae3a1023296c2c03258e6bc4ae4c02b6bf /models/pull.go
parent3f7f4852efaaa56a0dada832dc652a1fc8869ae7 (diff)
downloadgitea-dccb0c15b996ac4dc0307cbfed140ce1558d7e3c.tar.gz
gitea-dccb0c15b996ac4dc0307cbfed140ce1558d7e3c.zip
Replace convert.To with APIFormat calls
Diffstat (limited to 'models/pull.go')
-rw-r--r--models/pull.go18
1 files changed, 5 insertions, 13 deletions
diff --git a/models/pull.go b/models/pull.go
index 4a2a376704..d6df00dc7f 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -308,22 +308,14 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error
l.PushFront(mergeCommit)
p := &api.PushPayload{
- Ref: "refs/heads/" + pr.BaseBranch,
+ Ref: git.BRANCH_PREFIX + pr.BaseBranch,
Before: pr.MergeBase,
After: pr.MergedCommitID,
- CompareUrl: setting.AppUrl + pr.BaseRepo.ComposeCompareURL(pr.MergeBase, pr.MergedCommitID),
+ CompareURL: setting.AppUrl + pr.BaseRepo.ComposeCompareURL(pr.MergeBase, pr.MergedCommitID),
Commits: ListToPushCommits(l).ToApiPayloadCommits(pr.BaseRepo.FullLink()),
- Repo: pr.BaseRepo.ComposePayload(),
- Pusher: &api.PayloadAuthor{
- Name: pr.HeadRepo.MustOwner().DisplayName(),
- Email: pr.HeadRepo.MustOwner().Email,
- UserName: pr.HeadRepo.MustOwner().Name,
- },
- Sender: &api.PayloadUser{
- UserName: doer.Name,
- ID: doer.ID,
- AvatarUrl: doer.AvatarLink(),
- },
+ Repo: pr.BaseRepo.APIFormat(nil),
+ Pusher: pr.HeadRepo.MustOwner().APIFormat(),
+ Sender: doer.APIFormat(),
}
if err = PrepareWebhooks(pr.BaseRepo, HOOK_EVENT_PUSH, p); err != nil {
return fmt.Errorf("PrepareWebhooks: %v", err)