MCPcopy Index your code
hub / github.com/go-git/go-git / updateShallow

Method updateShallow

remote.go:1486–1507  ·  view source on GitHub ↗
(o *FetchOptions, resp *packp.UploadPackResponse)

Source from the content-addressed store, hash-verified

1484}
1485
1486func (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
1496outer:
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
1509func (r *Remote) checkRequireRemoteRefs(requires []config.RefSpec, remoteRefs storer.ReferenceStorer) error {
1510 for _, require := range requires {

Callers 2

TestUpdateShallowsMethod · 0.95
fetchPackMethod · 0.95

Calls 2

ShallowMethod · 0.65
SetShallowMethod · 0.65

Tested by 1

TestUpdateShallowsMethod · 0.76