Merge pull request 'Add:/compare/*' (#35) from wonderful/gitea-1156:develop into develop

This commit is contained in:
yystopf 2021-12-20 11:47:49 +08:00
commit 5de0fa2f7c
1 changed files with 3 additions and 3 deletions

View File

@ -583,7 +583,7 @@ func Routes() *web.Route {
m.Use(context.ToggleAPI(&context.ToggleOptions{
SignInRequired: setting.Service.RequireSignInView,
}))
reqRepoCodeReader := context.RequireRepoReader(models.UnitTypeCode)
m.Group("", func() {
// Miscellaneous
if setting.API.EnableSwagger {
@ -757,8 +757,8 @@ func Routes() *web.Route {
m.Get("/files", context.RepoRef(), repo.GetPullFiles)
m.Get("/issues", context.RepoRef(), repo.GetPullIssues)
})
// m.Get("/compare/*", context.RepoAssignment(), repo.MustBeNotEmpty, reqRepoCodeReader,
// repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.CompareDiff)
m.Get("/compare/*", repo.MustBeNotEmpty, reqRepoCodeReader,
repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.CompareDiff)
// m.Get("/src/commit/*", context.RepoRefByType(context.RepoRefCommit), repo.GetFileContents)
m.Get("/src/commit/*", context.RepoRefByType(context.RepoRefCommit), repo.GetFileContents)
//end by coder