| 1484 | } |
| 1485 | |
| 1486 | func (r *Remote) updateShallow(o *FetchOptions, resp *packp.UploadPackResponse) error { |
| 1487 | if o.Depth == 0 || len(resp.Shallows) == 0 { |
| 1488 | return nil |
| 1489 | } |
| 1490 | |
| 1491 | shallows, err := r.s.Shallow() |
| 1492 | if err != nil { |
| 1493 | return err |
| 1494 | } |
| 1495 | |
| 1496 | outer: |
| 1497 | for _, s := range resp.Shallows { |
| 1498 | for _, oldS := range shallows { |
| 1499 | if s == oldS { |
| 1500 | continue outer |
| 1501 | } |
| 1502 | } |
| 1503 | shallows = append(shallows, s) |
| 1504 | } |
| 1505 | |
| 1506 | return r.s.SetShallow(shallows) |
| 1507 | } |
| 1508 | |
| 1509 | func (r *Remote) checkRequireRemoteRefs(requires []config.RefSpec, remoteRefs storer.ReferenceStorer) error { |
| 1510 | for _, require := range requires { |