MCPcopy Create free account
hub / github.com/go-git/go-git / getRemoteRefsFromStorer

Function getRemoteRefsFromStorer

remote.go:847–865  ·  view source on GitHub ↗
(remoteRefStorer storer.ReferenceStorer)

Source from the content-addressed store, hash-verified

845}
846
847func getRemoteRefsFromStorer(remoteRefStorer storer.ReferenceStorer) (
848 map[plumbing.Hash]bool, error) {
849 remoteRefs := map[plumbing.Hash]bool{}
850 iter, err := remoteRefStorer.IterReferences()
851 if err != nil {
852 return nil, err
853 }
854 err = iter.ForEach(func(ref *plumbing.Reference) error {
855 if ref.Type() != plumbing.HashReference {
856 return nil
857 }
858 remoteRefs[ref.Hash()] = true
859 return nil
860 })
861 if err != nil {
862 return nil, err
863 }
864 return remoteRefs, nil
865}
866
867// getHavesFromRef populates the given `haves` map with the given
868// reference, and up to `maxHavesToVisitPerRef` ancestor commits.

Callers 1

getHavesFunction · 0.85

Calls 4

IterReferencesMethod · 0.65
ForEachMethod · 0.65
TypeMethod · 0.65
HashMethod · 0.65

Tested by

no test coverage detected