]> source.dussan.org Git - gitea.git/commitdiff
Use router param for filepath in GetRawFile (#19499)
authorJohn Olheiser <john.olheiser@gmail.com>
Tue, 26 Apr 2022 17:15:45 +0000 (12:15 -0500)
committerGitHub <noreply@github.com>
Tue, 26 Apr 2022 17:15:45 +0000 (12:15 -0500)
* Use router param for filepath

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Move TreePath back into RepoRefForAPI

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
modules/context/api.go

index 41d559f5b1c5fb6502dde3c820506ebbba984426..7d281b998a7df18944f115ca3ec615293cf31417 100644 (file)
@@ -362,6 +362,7 @@ func RepoRefForAPI(next http.Handler) http.Handler {
                                return
                        }
                        ctx.Repo.Commit = commit
+                       ctx.Repo.TreePath = ctx.Params("*")
                        return
                }