summaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-01 19:26:39 -0400
committerUnknwon <u@gogs.io>2015-09-01 19:26:39 -0400
commitebf1bd4f518971253e0a7a0e923645c1d584e03e (patch)
tree4ada3c53f5cef5928405370e4c528789112b7549 /routers/repo
parent8c046073a891e3a192794869628763ef072002eb (diff)
downloadgitea-ebf1bd4f518971253e0a7a0e923645c1d584e03e.tar.gz
gitea-ebf1bd4f518971253e0a7a0e923645c1d584e03e.zip
add view pull desc
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/issue.go3
-rw-r--r--routers/repo/pull.go15
2 files changed, 11 insertions, 7 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index fb9bc71ea0..882bf6968c 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -461,6 +461,9 @@ func ViewIssue(ctx *middleware.Context) {
// Get more information if it's a pull request.
if issue.IsPull {
+ ctx.Data["HeadTarget"] = issue.PullRepo.HeadUserName + "/" + issue.PullRepo.HeadBarcnh
+ ctx.Data["BaseTarget"] = ctx.Repo.Owner.Name + "/" + issue.PullRepo.BaseBranch
+
headRepoPath, err := issue.PullRepo.HeadRepo.RepoPath()
if err != nil {
ctx.Handle(500, "PullRepo.HeadRepo.RepoPath", err)
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index 8d0dbecfbf..bb5237400a 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -314,7 +314,7 @@ func CompareAndPullRequestPost(ctx *middleware.Context, form auth.CreateIssueFor
attachments []string
)
- _, headRepo, headGitRepo, prInfo, baseBranch, headBranch := ParseCompareInfo(ctx)
+ headUser, headRepo, headGitRepo, prInfo, baseBranch, headBranch := ParseCompareInfo(ctx)
if ctx.Written() {
return
}
@@ -351,12 +351,13 @@ func CompareAndPullRequestPost(ctx *middleware.Context, form auth.CreateIssueFor
Content: form.Content,
}
if err := models.NewPullRequest(repo, pr, labelIDs, attachments, &models.PullRepo{
- HeadRepoID: headRepo.ID,
- BaseRepoID: repo.ID,
- HeadBarcnh: headBranch,
- BaseBranch: baseBranch,
- MergeBase: prInfo.MergeBase,
- Type: models.PULL_REQUEST_GOGS,
+ HeadRepoID: headRepo.ID,
+ BaseRepoID: repo.ID,
+ HeadUserName: headUser.Name,
+ HeadBarcnh: headBranch,
+ BaseBranch: baseBranch,
+ MergeBase: prInfo.MergeBase,
+ Type: models.PULL_REQUEST_GOGS,
}, patch); err != nil {
ctx.Handle(500, "NewPullRequest", err)
return