diff options
author | mrsdizzie <info@mrsdizzie.com> | 2019-03-26 15:59:48 -0400 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-03-26 21:59:48 +0200 |
commit | d056bf300ff5ebd89d8b0035722c94a3b08ac745 (patch) | |
tree | 731708f1ddc55c1c406b5c7670a998e827e0cecc /routers/repo | |
parent | b4941f707b0fd950fc2a0b12b34fbc37206e23dd (diff) | |
download | gitea-d056bf300ff5ebd89d8b0035722c94a3b08ac745.tar.gz gitea-d056bf300ff5ebd89d8b0035722c94a3b08ac745.zip |
Clean up ref name rules (#6437)
* Clean up ref name rules
Clean up checks on reference names to better conform to the guideline
here: https://git-scm.com/docs/git-check-ref-format
This fixes half of #6321
* Update branch create integration test
According to: https://git-scm.com/docs/git-check-ref-format
And: git check-ref-format "master/feature=test1"
This is a valid branch name and we should not be testing for it to fail.
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/branch.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go index 823b031a48..44fd4bcd18 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -14,6 +14,7 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/util" ) const ( @@ -250,5 +251,5 @@ func CreateBranch(ctx *context.Context, form auth.NewBranchForm) { } ctx.Flash.Success(ctx.Tr("repo.branch.create_success", form.NewBranchName)) - ctx.Redirect(ctx.Repo.RepoLink + "/src/branch/" + form.NewBranchName) + ctx.Redirect(ctx.Repo.RepoLink + "/src/branch/" + util.PathEscapeSegments(form.NewBranchName)) } |