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

Method findObjectInPackfile

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

Source from the content-addressed store, hash-verified

549}
550
551func (s *ObjectStorage) findObjectInPackfile(h plumbing.Hash) (plumbing.Hash, plumbing.Hash, int64) {
552 for packfile, index := range s.index {
553 offset, err := index.FindOffset(h)
554 if err == nil {
555 return packfile, h, offset
556 }
557 }
558
559 return plumbing.ZeroHash, plumbing.ZeroHash, -1
560}
561
562// HashesWithPrefix returns all objects with a hash that starts with a prefix by searching for
563// 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