aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2022-09-15 15:25:16 +0200
committerGitHub <noreply@github.com>2022-09-15 21:25:16 +0800
commitbf325d44120c4a6fc7f67ff1dc25db770247c9a7 (patch)
treec685496a02305cedcaa6be45f864a1ece6aadd93 /templates
parentef40324c431a6cf58ff775128da48fc48c9852fe (diff)
downloadgitea-bf325d44120c4a6fc7f67ff1dc25db770247c9a7.tar.gz
gitea-bf325d44120c4a6fc7f67ff1dc25db770247c9a7.zip
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.
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/branch_dropdown.tmpl3
1 files changed, 3 insertions, 0 deletions
diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl
index 9d1ec10d3c..2010fe261e 100644
--- a/templates/repo/branch_dropdown.tmpl
+++ b/templates/repo/branch_dropdown.tmpl
@@ -94,6 +94,9 @@
{{.root.CsrfTokenHtml}}
<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="{{.root.TreePath}}">
+ {{end}}
</form>
</div>
</div>