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

Function depthChanged

remote.go:500–521  ·  view source on GitHub ↗
(before []plumbing.Hash, s storage.Storer)

Source from the content-addressed store, hash-verified

498}
499
500func depthChanged(before []plumbing.Hash, s storage.Storer) (bool, error) {
501 after, err := s.Shallow()
502 if err != nil {
503 return false, err
504 }
505
506 if len(before) != len(after) {
507 return true, nil
508 }
509
510 bm := make(map[plumbing.Hash]bool, len(before))
511 for _, b := range before {
512 bm[b] = true
513 }
514 for _, a := range after {
515 if _, ok := bm[a]; !ok {
516 return true, nil
517 }
518 }
519
520 return false, nil
521}
522
523func newUploadPackSession(url string, auth transport.AuthMethod, insecure bool, cabundle []byte, proxyOpts transport.ProxyOptions) (transport.UploadPackSession, error) {
524 c, ep, err := newClient(url, insecure, cabundle, proxyOpts)

Callers 1

fetchMethod · 0.85

Calls 1

ShallowMethod · 0.65

Tested by

no test coverage detected