0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-18 10:52:56 +02:00
This commit is contained in:
Lunny Xiao 2025-01-12 21:43:24 -08:00
parent 67a749f52c
commit ab98bfba9d
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -56,7 +56,15 @@ func isExcludedEntry(entry *git.TreeEntry) bool {
func Tree(ctx *context.Context) {
treePath := ctx.PathParam("*")
refFullName := git.RefName("refs/" + ctx.FormTrim("ref"))
var refFullName git.RefName
switch ctx.FormTrim("ref_type") {
case "branch":
refFullName = git.RefNameFromBranch(ctx.FormTrim("ref_name"))
case "tag":
refFullName = git.RefNameFromTag(ctx.FormTrim("ref_name"))
default:
refFullName = git.RefName(ctx.FormTrim("ref_name"))
}
recursive := ctx.FormBool("recursive")
var results []*files_service.TreeViewNode