MCPcopy Create free account
hub / github.com/go-git/go-git / updateRemoteReferenceStorage

Method updateRemoteReferenceStorage

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

Source from the content-addressed store, hash-verified

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