MCPcopy
hub / github.com/go-git/go-git / updateRemoteReferenceStorage

Method updateRemoteReferenceStorage

remote.go:351–377  ·  view source on GitHub ↗
(
	req *packp.ReferenceUpdateRequest,
)

Source from the content-addressed store, hash-verified

349}
350
351func (r *Remote) updateRemoteReferenceStorage(
352 req *packp.ReferenceUpdateRequest,
353) error {
354
355 for _, spec := range r.c.Fetch {
356 for _, c := range req.Commands {
357 if !spec.Match(c.Name) {
358 continue
359 }
360
361 local := spec.Dst(c.Name)
362 ref := plumbing.NewHashReference(local, c.New)
363 switch c.Action() {
364 case packp.Create, packp.Update:
365 if err := r.s.SetReference(ref); err != nil {
366 return err
367 }
368 case packp.Delete:
369 if err := r.s.RemoveReference(local); err != nil {
370 return err
371 }
372 }
373 }
374 }
375
376 return nil
377}
378
379// FetchContext fetches references along with the objects necessary to complete
380// their histories.

Callers 1

PushContextMethod · 0.95

Calls 6

NewHashReferenceFunction · 0.92
DstMethod · 0.80
MatchMethod · 0.65
SetReferenceMethod · 0.65
RemoveReferenceMethod · 0.65
ActionMethod · 0.45

Tested by

no test coverage detected