summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-09-03 06:00:59 -0400
committerUnknwon <u@gogs.io>2016-09-03 06:00:59 -0400
commit491407ddf89fb4182c5401c47d2af38f0a30adca (patch)
treecb6608b158bfebb68d41ac7f2c595b13d8ce393d /cmd
parent6da55159a2af518f5d7e5cafbb50c356d9e96383 (diff)
downloadgitea-491407ddf89fb4182c5401c47d2af38f0a30adca.tar.gz
gitea-491407ddf89fb4182c5401c47d2af38f0a30adca.zip
#3590 fix 404 for release draft edition
Closes #3591
Diffstat (limited to 'cmd')
-rw-r--r--cmd/web.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/cmd/web.go b/cmd/web.go
index cc4eb2aa1a..97f6a0f15c 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -497,11 +497,27 @@ func runWeb(ctx *cli.Context) error {
m.Group("/releases", func() {
m.Get("/new", repo.NewRelease)
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)
- m.Get("/edit/*", repo.EditRelease)
- m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
m.Post("/delete", repo.DeleteRelease)
}, reqRepoWriter, context.RepoRef())
+ m.Group("/releases", func() {
+ m.Get("/edit/*", repo.EditRelease)
+ m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
+ }, reqRepoWriter, func(ctx *context.Context) {
+ var err error
+ ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.Repository.DefaultBranch)
+ if err != nil {
+ ctx.Handle(500, "GetBranchCommit", err)
+ return
+ }
+ ctx.Repo.CommitsCount, err = ctx.Repo.Commit.CommitsCount()
+ if err != nil {
+ ctx.Handle(500, "CommitsCount", err)
+ return
+ }
+ ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
+ })
+
m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest).
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost)