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

Method Objects

storage/filesystem/dotgit/dotgit.go:405–424  ·  view source on GitHub ↗

Objects returns a slice with the hashes of objects found under the .git/objects/ directory.

()

Source from the content-addressed store, hash-verified

403// Objects returns a slice with the hashes of objects found under the
404// .git/objects/ directory.
405func (d *DotGit) Objects() ([]plumbing.Hash, error) {
406 if d.options.ExclusiveAccess {
407 err := d.genObjectList()
408 if err != nil {
409 return nil, err
410 }
411
412 return d.objectList, nil
413 }
414
415 var objects []plumbing.Hash
416 err := d.ForEachObjectHash(func(hash plumbing.Hash) error {
417 objects = append(objects, hash)
418 return nil
419 })
420 if err != nil {
421 return nil, err
422 }
423 return objects, nil
424}
425
426// ForEachObjectHash iterates over the hashes of objects found under the
427// .git/objects/ directory and executes the provided function.

Callers 4

ObjectsWithPrefixMethod · 0.95
IterEncodedObjectsMethod · 0.45
testObjectsFunction · 0.45
TestObjectsNoFolderMethod · 0.45

Calls 2

genObjectListMethod · 0.95
ForEachObjectHashMethod · 0.95

Tested by 2

testObjectsFunction · 0.36
TestObjectsNoFolderMethod · 0.36