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

Method walkAllRefs

object_walker.go:25–40  ·  view source on GitHub ↗

walkAllRefs walks all (hash) references from the repo.

()

Source from the content-addressed store, hash-verified

23
24// walkAllRefs walks all (hash) references from the repo.
25func (p *objectWalker) walkAllRefs() error {
26 // Walk over all the references in the repo.
27 it, err := p.Storer.IterReferences()
28 if err != nil {
29 return err
30 }
31 defer it.Close()
32 err = it.ForEach(func(ref *plumbing.Reference) error {
33 // Exit this iteration early for non-hash references.
34 if ref.Type() != plumbing.HashReference {
35 return nil
36 }
37 return p.walkObjectTree(ref.Hash())
38 })
39 return err
40}
41
42func (p *objectWalker) isSeen(hash plumbing.Hash) bool {
43 _, seen := p.seen[hash]

Callers 2

createNewObjectPackMethod · 0.80
PruneMethod · 0.80

Calls 6

walkObjectTreeMethod · 0.95
IterReferencesMethod · 0.65
CloseMethod · 0.65
ForEachMethod · 0.65
TypeMethod · 0.65
HashMethod · 0.65

Tested by

no test coverage detected