( rs config.RefSpec, localRefs []*plumbing.Reference, refsDict map[string]*plumbing.Reference, remoteRefs storer.ReferenceStorer, req *packp.ReferenceUpdateRequest, forceWithLease *ForceWithLease, )
| 654 | } |
| 655 | |
| 656 | func (r *Remote) addOrUpdateReferences( |
| 657 | rs config.RefSpec, |
| 658 | localRefs []*plumbing.Reference, |
| 659 | refsDict map[string]*plumbing.Reference, |
| 660 | remoteRefs storer.ReferenceStorer, |
| 661 | req *packp.ReferenceUpdateRequest, |
| 662 | forceWithLease *ForceWithLease, |
| 663 | ) error { |
| 664 | // If it is not a wildcard refspec we can directly search for the reference |
| 665 | // in the references dictionary. |
| 666 | if !rs.IsWildcard() { |
| 667 | ref, ok := refsDict[rs.Src()] |
| 668 | if !ok { |
| 669 | commit, err := object.GetCommit(r.s, plumbing.NewHash(rs.Src())) |
| 670 | if err == nil { |
| 671 | return r.addCommit(rs, remoteRefs, commit.Hash, req) |
| 672 | } |
| 673 | return nil |
| 674 | } |
| 675 | |
| 676 | return r.addReferenceIfRefSpecMatches(rs, remoteRefs, ref, req, forceWithLease) |
| 677 | } |
| 678 | |
| 679 | for _, ref := range localRefs { |
| 680 | err := r.addReferenceIfRefSpecMatches(rs, remoteRefs, ref, req, forceWithLease) |
| 681 | if err != nil { |
| 682 | return err |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | return nil |
| 687 | } |
| 688 | |
| 689 | func (r *Remote) deleteReferences(rs config.RefSpec, |
| 690 | remoteRefs storer.ReferenceStorer, |
no test coverage detected