1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-19 08:48:37 +00:00

Fix raw file API ref handling (#33172)

Fix #33164 and add more tests
This commit is contained in:
wxiaoguang
2025-01-10 09:31:49 +08:00
committed by GitHub
parent 8f8ad8e272
commit 65aae0912a
3 changed files with 48 additions and 43 deletions

View File

@@ -293,8 +293,7 @@ func RepoRefForAPI(next http.Handler) http.Handler {
return
}
// NOTICE: the "ref" here for internal usage only (e.g. woodpecker)
refName, _ := getRefNameLegacy(ctx.Base, ctx.Repo, ctx.FormTrim("ref"))
refName, _ := getRefNameLegacy(ctx.Base, ctx.Repo, ctx.PathParam("*"), ctx.FormTrim("ref"))
var err error
if ctx.Repo.GitRepo.IsBranchExist(refName) {