mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 21:54:23 +00:00
refactor: remove Path field from git.Repository (#38552)
The "path" details should be hidden to other packages By the way, fix a resource leaking in gogit's CommitNodeIndex (the file was not closed in CacheCommit)
This commit is contained in:
@@ -20,13 +20,13 @@ func (te *TreeEntry) GetSize(ctx context.Context, gitRepo *Repository) int64 {
|
||||
|
||||
batch, cancel, err := gitRepo.CatFileBatch(ctx)
|
||||
if err != nil {
|
||||
log.Debug("error whilst reading size for %s in %s. Error: %v", te.ID.String(), gitRepo.Path, err)
|
||||
log.Debug("error whilst reading size for %s in %s. Error: %v", te.ID.String(), gitRepo.LogString(), err)
|
||||
return 0
|
||||
}
|
||||
defer cancel()
|
||||
info, err := batch.QueryInfo(te.ID.String())
|
||||
if err != nil {
|
||||
log.Debug("error whilst reading size for %s in %s. Error: %v", te.ID.String(), gitRepo.Path, err)
|
||||
log.Debug("error whilst reading size for %s in %s. Error: %v", te.ID.String(), gitRepo.LogString(), err)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user