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

Method findObjectInPackfile

storage/filesystem/object.go:542–551  ·  view source on GitHub ↗
(h plumbing.Hash)

Source from the content-addressed store, hash-verified

540}
541
542func (s *ObjectStorage) findObjectInPackfile(h plumbing.Hash) (plumbing.Hash, plumbing.Hash, int64) {
543 for packfile, index := range s.index {
544 offset, err := index.FindOffset(h)
545 if err == nil {
546 return packfile, h, offset
547 }
548 }
549
550 return plumbing.ZeroHash, plumbing.ZeroHash, -1
551}
552
553// HashesWithPrefix returns all objects with a hash that starts with a prefix by searching for
554// them in the packfile and the git object directories.

Callers 3

HasEncodedObjectMethod · 0.95
getFromPackfileMethod · 0.95

Calls 1

FindOffsetMethod · 0.65

Tested by

no test coverage detected