Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep path when creating a new branch #21153

Merged
merged 4 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move PathEscapeSegments
  • Loading branch information
JakobDev committed Sep 15, 2022
commit aff21fc78014be62d3c247b0691a8727124c756d
2 changes: 1 addition & 1 deletion routers/web/repo/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) + "/" + form.CurrentPath)
ctx.Redirect(ctx.Repo.RepoLink + "/src/branch/" + util.PathEscapeSegments(form.NewBranchName) + "/" + util.PathEscapeSegments(form.CurrentPath))
wxiaoguang marked this conversation as resolved.
Show resolved Hide resolved
}
2 changes: 1 addition & 1 deletion templates/repo/branch_dropdown.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<input type="hidden" name="new_branch_name" v-model="searchTerm">
<input type="hidden" name="create_tag" v-model="createTag">
{{if $.root.TreePath}}
<input type="hidden" name="current_path" value="{{PathEscapeSegments .root.TreePath}}">
<input type="hidden" name="current_path" value="{{.root.TreePath}}">
{{end}}
</form>
</div>
Expand Down