MCPcopy Create free account
hub / github.com/go-git/go-git / packfileFromCache

Method packfileFromCache

storage/filesystem/object.go:229–240  ·  view source on GitHub ↗
(hash plumbing.Hash)

Source from the content-addressed store, hash-verified

227}
228
229func (s *ObjectStorage) packfileFromCache(hash plumbing.Hash) *packfile.Packfile {
230 if s.packfiles == nil {
231 if s.options.KeepDescriptors {
232 s.packfiles = make(map[plumbing.Hash]*packfile.Packfile)
233 } else if s.options.MaxOpenDescriptors > 0 {
234 s.packList = make([]plumbing.Hash, s.options.MaxOpenDescriptors)
235 s.packfiles = make(map[plumbing.Hash]*packfile.Packfile, s.options.MaxOpenDescriptors)
236 }
237 }
238
239 return s.packfiles[hash]
240}
241
242func (s *ObjectStorage) storePackfileInCache(hash plumbing.Hash, p *packfile.Packfile) error {
243 if s.options.KeepDescriptors {

Callers 1

packfileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected