forked from forgejo/forgejo
* Make branch deletion URL more like GitHub's, fixes #1397 * Add PR branch deletion integration test * Do not allow deleting protected branch * Change http error code to 403 if user has no write rights to repository * Add check to not panic if forked repository has alrady been deleted
This commit is contained in:
parent
6db387a21e
commit
0a5dc640a1
7 changed files with 241 additions and 70 deletions
|
@ -562,9 +562,6 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
m.Get("/milestones", repo.Milestones)
|
||||
}, context.RepoRef())
|
||||
|
||||
// m.Get("/branches", repo.Branches)
|
||||
m.Post("/branches/:name/delete", reqSignIn, reqRepoWriter, repo.MustBeNotBare, repo.DeleteBranchPost)
|
||||
|
||||
m.Group("/wiki", func() {
|
||||
m.Get("/?:page", repo.Wiki)
|
||||
m.Get("/_pages", repo.WikiPages)
|
||||
|
@ -589,6 +586,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
m.Get("/commits", context.RepoRef(), repo.ViewPullCommits)
|
||||
m.Get("/files", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.ViewPullFiles)
|
||||
m.Post("/merge", reqRepoWriter, repo.MergePullRequest)
|
||||
m.Post("/cleanup", context.RepoRef(), repo.CleanUpPullRequest)
|
||||
}, repo.MustAllowPulls, context.CheckUnit(models.UnitTypePullRequests))
|
||||
|
||||
m.Group("", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue