mirror of https://github.com/gogs/gogs.git
routers/repo/branch: fix can't delete branch with slashes after merge (#4089)
parent
e893e1fc63
commit
074c92b0a3
|
@ -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)
|
||||
|
|
2
gogs.go
2
gogs.go
|
@ -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
|
@ -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() {
|
||||
|
|
|
@ -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"])
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.9.135.0209
|
||||
0.9.136.0209
|
Loading…
Reference in New Issue