Skip to content

Commit

Permalink
Fix branch list auth (#26041)
Browse files Browse the repository at this point in the history
The public repositories' branch list dropdown will return wrong because
it requires login wrongly.
Caused by #25719
  • Loading branch information
lunny authored Jul 22, 2023
1 parent a7e8273 commit c42b718
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,6 @@ func registerRoutes(m *web.Route) {
}, context.RepoRef(), canEnableEditor, context.RepoMustNotBeArchived())

m.Group("/branches", func() {
m.Get("/list", repo.GetBranchesList)
m.Group("/_new", func() {
m.Post("/branch/*", context.RepoRefByType(context.RepoRefBranch), repo.CreateBranch)
m.Post("/tag/*", context.RepoRefByType(context.RepoRefTag), repo.CreateBranch)
Expand Down Expand Up @@ -1248,6 +1247,7 @@ func registerRoutes(m *web.Route) {
}, repo.MustBeNotEmpty, dlSourceEnabled, reqRepoCodeReader)

m.Group("/branches", func() {
m.Get("/list", repo.GetBranchesList)
m.Get("", repo.Branches)
}, repo.MustBeNotEmpty, context.RepoRef(), reqRepoCodeReader)

Expand Down

0 comments on commit c42b718

Please sign in to comment.