routers/repo/branch: fix can't delete branch with slashes after merge (#4089)

pull/3954/merge
Unknwon 2017-02-09 15:25:48 -05:00
parent e893e1fc63
commit 074c92b0a3
No known key found for this signature in database
GPG Key ID: FB9F411CDD69BEC1
6 changed files with 7 additions and 7 deletions

View File

@ -570,7 +570,7 @@ func runWeb(ctx *cli.Context) error {
}, context.RepoRef())
// m.Get("/branches", repo.Branches)
m.Post("/branches/:name/delete", reqSignIn, reqRepoWriter, repo.DeleteBranchPost)
m.Post("/branches/delete/*", reqSignIn, reqRepoWriter, repo.DeleteBranchPost)
m.Group("/wiki", func() {
m.Get("/?:page", repo.Wiki)

View File

@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
const APP_VER = "0.9.135.0209"
const APP_VER = "0.9.136.0209"
func init() {
setting.AppVer = APP_VER

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@ func Branches(ctx *context.Context) {
}
func DeleteBranchPost(ctx *context.Context) {
branchName := ctx.Params(":name")
branchName := ctx.Params("*")
commitID := ctx.Query("commit")
defer func() {

View File

@ -639,7 +639,7 @@ func ViewIssue(ctx *context.Context) {
ctx.Data["IsPullBranchDeletable"] = pull.BaseRepoID == pull.HeadRepoID &&
ctx.Repo.IsWriter() && ctx.Repo.GitRepo.IsBranchExist(pull.HeadBranch)
deleteBranchUrl := ctx.Repo.RepoLink + "/branches/" + pull.HeadBranch + "/delete"
deleteBranchUrl := ctx.Repo.RepoLink + "/branches/delete/" + pull.HeadBranch
ctx.Data["DeleteBranchLink"] = fmt.Sprintf("%s?commit=%s&redirect_to=%s", deleteBranchUrl, pull.MergedCommitID, ctx.Data["Link"])
}

View File

@ -1 +1 @@
0.9.135.0209
0.9.136.0209