walkAllRefs walks all (hash) references from the repo.
()
| 23 | |
| 24 | // walkAllRefs walks all (hash) references from the repo. |
| 25 | func (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 | |
| 42 | func (p *objectWalker) isSeen(hash plumbing.Hash) bool { |
| 43 | _, seen := p.seen[hash] |
no test coverage detected