| 510 | } |
| 511 | |
| 512 | func depthChanged(before []plumbing.Hash, s storage.Storer) (bool, error) { |
| 513 | after, err := s.Shallow() |
| 514 | if err != nil { |
| 515 | return false, err |
| 516 | } |
| 517 | |
| 518 | if len(before) != len(after) { |
| 519 | return true, nil |
| 520 | } |
| 521 | |
| 522 | bm := make(map[plumbing.Hash]bool, len(before)) |
| 523 | for _, b := range before { |
| 524 | bm[b] = true |
| 525 | } |
| 526 | for _, a := range after { |
| 527 | if _, ok := bm[a]; !ok { |
| 528 | return true, nil |
| 529 | } |
| 530 | } |
| 531 | |
| 532 | return false, nil |
| 533 | } |
| 534 | |
| 535 | func newUploadPackSession(url string, auth transport.AuthMethod, insecure bool, clientCert, clientKey, caBundle []byte, proxyOpts transport.ProxyOptions) (transport.UploadPackSession, error) { |
| 536 | c, ep, err := newClient(url, insecure, clientCert, clientKey, caBundle, proxyOpts) |