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

Method ForEachObjectHash

storage/filesystem/dotgit/dotgit.go:428–446  ·  view source on GitHub ↗

ForEachObjectHash iterates over the hashes of objects found under the .git/objects/ directory and executes the provided function.

(fun func(plumbing.Hash) error)

Source from the content-addressed store, hash-verified

426// ForEachObjectHash iterates over the hashes of objects found under the
427// .git/objects/ directory and executes the provided function.
428func (d *DotGit) ForEachObjectHash(fun func(plumbing.Hash) error) error {
429 if !d.options.ExclusiveAccess {
430 return d.forEachObjectHash(fun)
431 }
432
433 err := d.genObjectList()
434 if err != nil {
435 return err
436 }
437
438 for _, h := range d.objectList {
439 err := fun(h)
440 if err != nil {
441 return err
442 }
443 }
444
445 return nil
446}
447
448func (d *DotGit) forEachObjectHash(fun func(plumbing.Hash) error) error {
449 files, err := d.fs.ReadDir(objectsPath)

Callers 2

ObjectsWithPrefixMethod · 0.95
ObjectsMethod · 0.95

Calls 2

forEachObjectHashMethod · 0.95
genObjectListMethod · 0.95

Tested by

no test coverage detected