summaryrefslogtreecommitdiffstats
path: root/routers/repo/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r--routers/repo/pull.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index d1e2f0b0b3..412750dd55 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -946,9 +946,15 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
return
}
+ maxIndex, err := models.GetMaxIndexOfIssue(repo.ID)
+ if err != nil {
+ ctx.ServerError("GetPatch", err)
+ return
+ }
+
pullIssue := &models.Issue{
RepoID: repo.ID,
- Index: repo.NextIssueIndex(),
+ Index: maxIndex + 1,
Title: form.Title,
PosterID: ctx.User.ID,
Poster: ctx.User,