mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-08 22:48:02 +02: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:
1 parent
9dc04289aa
commit
a4526d5a82
28 files changed
+146
-107
No files matched your search
@@ -58,13 +58,13 @@ func (b *Blob) Size(ctx context.Context) int64 {
|
||||
|
||||
batch, cancel, err := b.repo.CatFileBatch(ctx)
|
||||
if err != nil {
|
||||
log.Debug("error whilst reading size for %s in %s. Error: %v", b.ID.String(), b.repo.Path, err)
|
||||
log.Debug("error whilst reading size for %s in %s. Error: %v", b.ID.String(), b.repo.LogString(), err)
|
||||
return 0
|
||||
}
|
||||
defer cancel()
|
||||
info, err := batch.QueryInfo(b.ID.String())
|
||||
if err != nil {
|
||||
log.Debug("error whilst reading size for %s in %s. Error: %v", b.ID.String(), b.repo.Path, err)
|
||||
log.Debug("error whilst reading size for %s in %s. Error: %v", b.ID.String(), b.repo.LogString(), err)
|
||||
return 0
|
||||
}
|
||||
b.gotSize = true
|
||||
|
||||
Reference in new issue
Block a user