( o *PushOptions, localRefs []*plumbing.Reference, remoteRefs storer.ReferenceStorer, ar *packp.AdvRefs, )
| 306 | } |
| 307 | |
| 308 | func (r *Remote) newReferenceUpdateRequest( |
| 309 | o *PushOptions, |
| 310 | localRefs []*plumbing.Reference, |
| 311 | remoteRefs storer.ReferenceStorer, |
| 312 | ar *packp.AdvRefs, |
| 313 | ) (*packp.ReferenceUpdateRequest, error) { |
| 314 | req := packp.NewReferenceUpdateRequestFromCapabilities(ar.Capabilities) |
| 315 | |
| 316 | if o.Progress != nil { |
| 317 | req.Progress = o.Progress |
| 318 | if ar.Capabilities.Supports(capability.Sideband64k) { |
| 319 | _ = req.Capabilities.Set(capability.Sideband64k) |
| 320 | } else if ar.Capabilities.Supports(capability.Sideband) { |
| 321 | _ = req.Capabilities.Set(capability.Sideband) |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | if ar.Capabilities.Supports(capability.PushOptions) { |
| 326 | _ = req.Capabilities.Set(capability.PushOptions) |
| 327 | for k, v := range o.Options { |
| 328 | req.Options = append(req.Options, &packp.Option{Key: k, Value: v}) |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | if o.Atomic && ar.Capabilities.Supports(capability.Atomic) { |
| 333 | _ = req.Capabilities.Set(capability.Atomic) |
| 334 | } |
| 335 | |
| 336 | if err := r.addReferencesToUpdate(o.RefSpecs, localRefs, remoteRefs, req, o.Prune, o.ForceWithLease); err != nil { |
| 337 | |
| 338 | return nil, err |
| 339 | } |
| 340 | |
| 341 | if o.FollowTags { |
| 342 | if err := r.addReachableTags(localRefs, remoteRefs, req); err != nil { |
| 343 | return nil, err |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | return req, nil |
| 348 | } |
| 349 | |
| 350 | func (r *Remote) updateRemoteReferenceStorage( |
| 351 | req *packp.ReferenceUpdateRequest, |
no test coverage detected