refactor: remove Ctx field from git.Repository (#38500)

This commit is contained in:
wxiaoguang
2026-07-17 18:44:31 +08:00
committed by GitHub
parent 2c8e99bbf7
commit 5b078f72aa
235 changed files with 1234 additions and 1258 deletions
+4 -4
View File
@@ -86,11 +86,11 @@ func EntryFollowLink(ctx context.Context, gitRepo *Repository, commit *Commit, f
// git's filename max length is 4096, hopefully a link won't be longer than multiple of that
const maxSymlinkSize = 20 * 4096
if te.Blob(gitRepo).Size() > maxSymlinkSize {
if te.Blob(gitRepo).Size(ctx) > maxSymlinkSize {
return nil, util.ErrorWrap(util.ErrUnprocessableContent, "%q content exceeds symlink limit", fullPath)
}
link, err := te.Blob(gitRepo).GetBlobContent(maxSymlinkSize)
link, err := te.Blob(gitRepo).GetBlobContent(ctx, maxSymlinkSize)
if err != nil {
return nil, err
}
@@ -126,8 +126,8 @@ func EntryFollowLinks(ctx context.Context, gitRepo *Repository, commit *Commit,
return res, nil
}
func (te *TreeEntry) Tree(gitRepo *Repository) *Tree {
t, err := gitRepo.getTree(te.ID)
func (te *TreeEntry) Tree(ctx context.Context, gitRepo *Repository) *Tree {
t, err := gitRepo.getTree(ctx, te.ID)
if err != nil {
return nil
}