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

Function referencesToHashes

remote.go:1405–1425  ·  view source on GitHub ↗
(refs storer.ReferenceStorer)

Source from the content-addressed store, hash-verified

1403}
1404
1405func referencesToHashes(refs storer.ReferenceStorer) ([]plumbing.Hash, error) {
1406 iter, err := refs.IterReferences()
1407 if err != nil {
1408 return nil, err
1409 }
1410
1411 var hs []plumbing.Hash
1412 err = iter.ForEach(func(ref *plumbing.Reference) error {
1413 if ref.Type() != plumbing.HashReference {
1414 return nil
1415 }
1416
1417 hs = append(hs, ref.Hash())
1418 return nil
1419 })
1420 if err != nil {
1421 return nil, err
1422 }
1423
1424 return hs, nil
1425}
1426
1427func pushHashes(
1428 ctx context.Context,

Callers 1

PushContextMethod · 0.85

Calls 4

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

Tested by

no test coverage detected