Browse Source

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

pull/3855/merge
Unknwon 8 years ago
parent
commit
074c92b0a3
No known key found for this signature in database
GPG Key ID: FB9F411CDD69BEC1
  1. 2
      cmd/web.go
  2. 2
      gogs.go
  3. 4
      modules/bindata/bindata.go
  4. 2
      routers/repo/branch.go
  5. 2
      routers/repo/issue.go
  6. 2
      templates/.VERSION

2
cmd/web.go

@ -570,7 +570,7 @@ func runWeb(ctx *cli.Context) error {
}, context.RepoRef()) }, context.RepoRef())
// m.Get("/branches", repo.Branches) // 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.Group("/wiki", func() {
m.Get("/?:page", repo.Wiki) m.Get("/?:page", repo.Wiki)

2
gogs.go

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

4
modules/bindata/bindata.go

File diff suppressed because one or more lines are too long

2
routers/repo/branch.go

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

2
routers/repo/issue.go

@ -639,7 +639,7 @@ func ViewIssue(ctx *context.Context) {
ctx.Data["IsPullBranchDeletable"] = pull.BaseRepoID == pull.HeadRepoID && ctx.Data["IsPullBranchDeletable"] = pull.BaseRepoID == pull.HeadRepoID &&
ctx.Repo.IsWriter() && ctx.Repo.GitRepo.IsBranchExist(pull.HeadBranch) 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"]) ctx.Data["DeleteBranchLink"] = fmt.Sprintf("%s?commit=%s&redirect_to=%s", deleteBranchUrl, pull.MergedCommitID, ctx.Data["Link"])
} }

2
templates/.VERSION

@ -1 +1 @@
0.9.135.0209 0.9.136.0209
Loading…
Cancel
Save