MCPcopy Index your code
hub / github.com/go-git/go-git / packfileFromCache

Method packfileFromCache

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

Source from the content-addressed store, hash-verified

235}
236
237func (s *ObjectStorage) packfileFromCache(hash plumbing.Hash) *packfile.Packfile {
238 if s.packfiles == nil {
239 if s.options.KeepDescriptors {
240 s.packfiles = make(map[plumbing.Hash]*packfile.Packfile)
241 } else if s.options.MaxOpenDescriptors > 0 {
242 s.packList = make([]plumbing.Hash, s.options.MaxOpenDescriptors)
243 s.packfiles = make(map[plumbing.Hash]*packfile.Packfile, s.options.MaxOpenDescriptors)
244 }
245 }
246
247 return s.packfiles[hash]
248}
249
250func (s *ObjectStorage) storePackfileInCache(hash plumbing.Hash, p *packfile.Packfile) error {
251 if s.options.KeepDescriptors {

Callers 1

packfileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected