1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

Keep path when creating a new branch (#21153)

If you are create a new new branch while viewing file or directory, you
get redirected to the root of the repo. With this PR, you keep your
current path instead of getting redirected to the repo root.
This commit is contained in:
JakobDev
2022-09-15 15:25:16 +02:00
committed by GitHub
parent ef40324c43
commit bf325d4412
3 changed files with 5 additions and 1 deletions

View File

@@ -427,5 +427,5 @@ func CreateBranch(ctx *context.Context) {
}
ctx.Flash.Success(ctx.Tr("repo.branch.create_success", form.NewBranchName))
ctx.Redirect(ctx.Repo.RepoLink + "/src/branch/" + util.PathEscapeSegments(form.NewBranchName))
ctx.Redirect(ctx.Repo.RepoLink + "/src/branch/" + util.PathEscapeSegments(form.NewBranchName) + "/" + util.PathEscapeSegments(form.CurrentPath))
}