aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/web.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-12-18 06:20:27 +0800
committerGitHub <noreply@github.com>2021-12-17 22:20:27 +0000
commitb300e3f48524cf16f3898cad6b843f52196a22a3 (patch)
treebc1d96dc2a56a27856607d22a51f9ee01e95e150 /routers/web/web.go
parent4cbc865d835eb49722d22f8ac5019ccc17582a16 (diff)
downloadgitea-b300e3f48524cf16f3898cad6b843f52196a22a3.tar.gz
gitea-b300e3f48524cf16f3898cad6b843f52196a22a3.zip
Support open compare page directly (#17975)
* Support open compare page directly * simple code * Some improvements Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers/web/web.go')
-rw-r--r--routers/web/web.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/web/web.go b/routers/web/web.go
index 44ac751c31..6ede410e3e 100644
--- a/routers/web/web.go
+++ b/routers/web/web.go
@@ -702,6 +702,7 @@ func RegisterRoutes(m *web.Route) {
m.Group("/milestone", func() {
m.Get("/{id}", repo.MilestoneIssuesAndPulls)
}, reqRepoIssuesOrPullsReader, context.RepoRef())
+ m.Get("/compare", repo.MustBeNotEmpty, reqRepoCodeReader, repo.SetEditorconfigIfExists, ignSignIn, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.CompareDiff)
m.Combo("/compare/*", repo.MustBeNotEmpty, reqRepoCodeReader, repo.SetEditorconfigIfExists).
Get(ignSignIn, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.CompareDiff).
Post(reqSignIn, context.RepoMustNotBeArchived(), reqRepoPullsReader, repo.MustAllowPulls, bindIgnErr(forms.CreateIssueForm{}), repo.SetWhitespaceBehavior, repo.CompareAndPullRequestPost)