| 498 | } |
| 499 | |
| 500 | func 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 | |
| 523 | func 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) |