summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--gogs.go2
-rw-r--r--routers/repo/pull.go24
-rw-r--r--templates/.VERSION2
-rw-r--r--templates/repo/issue/comment_tab.tmpl2
5 files changed, 22 insertions, 10 deletions
diff --git a/README.md b/README.md
index f6ff6f929e..50a73eb0a6 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
-##### Current tip version: 0.9.78 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
+##### Current tip version: 0.9.79 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
| Web | UI | Preview |
|:-------------:|:-------:|:-------:|
diff --git a/gogs.go b/gogs.go
index bfa01013e4..52cf7a6594 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.9.78.0815"
+const APP_VER = "0.9.79.0815"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index c7fee92906..87bc7bc217 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -636,6 +636,7 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
ctx.Data["Title"] = ctx.Tr("repo.pulls.compare_changes")
ctx.Data["PageIsComparePull"] = true
ctx.Data["IsDiffCompare"] = true
+ ctx.Data["RequireHighlightJS"] = true
renderAttachmentSettings(ctx)
var (
@@ -648,12 +649,6 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
return
}
- patch, err := headGitRepo.GetPatch(prInfo.MergeBase, headBranch)
- if err != nil {
- ctx.Handle(500, "GetPatch", err)
- return
- }
-
labelIDs, milestoneID, assigneeID := ValidateRepoMetas(ctx, form)
if ctx.Written() {
return
@@ -664,10 +659,25 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
}
if ctx.HasError() {
+ auth.AssignForm(form, ctx.Data)
+
+ // This stage is already stop creating new pull request, so it does not matter if it has
+ // something to compare or not.
+ PrepareCompareDiff(ctx, headUser, headRepo, headGitRepo, prInfo, baseBranch, headBranch)
+ if ctx.Written() {
+ return
+ }
+
ctx.HTML(200, COMPARE_PULL)
return
}
+ patch, err := headGitRepo.GetPatch(prInfo.MergeBase, headBranch)
+ if err != nil {
+ ctx.Handle(500, "GetPatch", err)
+ return
+ }
+
pullIssue := &models.Issue{
RepoID: repo.ID,
Index: repo.NextIssueIndex(),
@@ -690,6 +700,8 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
MergeBase: prInfo.MergeBase,
Type: models.PULL_REQUEST_GOGS,
}
+ // FIXME: check error in the case two people send pull request at almost same time, give nice error prompt
+ // instead of 500.
if err := models.NewPullRequest(repo, pullIssue, labelIDs, attachments, pullRequest, patch); err != nil {
ctx.Handle(500, "NewPullRequest", err)
return
diff --git a/templates/.VERSION b/templates/.VERSION
index 289612dc43..4d4c0e73bf 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.9.78.0815 \ No newline at end of file
+0.9.79.0815 \ No newline at end of file
diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl
index 6f9c91542a..b009060cd1 100644
--- a/templates/repo/issue/comment_tab.tmpl
+++ b/templates/repo/issue/comment_tab.tmpl
@@ -5,7 +5,7 @@
</div>
<div class="ui bottom attached active tab segment" data-tab="write">
<textarea id="content" class="edit_area" name="content" tabindex="4" data-id="issue-{{.RepoName}}" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.Repo.RepoLink}}">
-{{if .IssueTemplate}}{{.IssueTemplate}}{{end}}{{if .PullRequestTemplate}}{{.PullRequestTemplate}}{{end}}</textarea>
+{{if .IssueTemplate}}{{.IssueTemplate}}{{else if .PullRequestTemplate}}{{.PullRequestTemplate}}{{else}}{{.content}}{{end}}</textarea>
</div>
<div class="ui bottom attached tab segment markdown" data-tab="preview">
{{.i18n.Tr "repo.release.loading"}}