refactor: hide git repo path details from more packages (#38601)

Remove `RepoPath` from "models/repo" package, remove `UserPath` from
"models/user" package, use `WithRepo` for more places, fine tune tests.
This commit is contained in:
wxiaoguang
2026-07-24 01:42:55 +08:00
committed by GitHub
parent 86a3048247
commit 7065637e61
22 changed files with 216 additions and 186 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ import (
"strings"
"gitea.dev/modules/git/gitcmd"
"gitea.dev/modules/git/gitrepo"
)
type lineCountWriter struct {
@@ -113,7 +114,7 @@ func (repo *Repository) GetFilesChangedBetween(ctx context.Context, base, head s
// ReadPatchCommit will check if a diff patch exists and return stats
func (repo *Repository) ReadPatchCommit(prID int64) (commitSHA string, err error) {
// Migrated repositories download patches to "pulls" location
repoFS := GetRepoFS(repo)
repoFS := gitrepo.RepoLocalFS(repo)
loadPatch, err := repoFS.Open(fmt.Sprintf("pulls/%d.patch", prID))
if err != nil {
return "", err