FetchContext fetches references along with the objects necessary to complete their histories, from the remote named as FetchOptions.RemoteName. Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are no changes to be fetched, or an error. The provided Context must be non-nil.
(ctx context.Context, o *FetchOptions)
| 1205 | // operation is complete, an error is returned. The context only affects the |
| 1206 | // transport operations. |
| 1207 | func (r *Repository) FetchContext(ctx context.Context, o *FetchOptions) error { |
| 1208 | if err := o.Validate(); err != nil { |
| 1209 | return err |
| 1210 | } |
| 1211 | |
| 1212 | remote, err := r.Remote(o.RemoteName) |
| 1213 | if err != nil { |
| 1214 | return err |
| 1215 | } |
| 1216 | |
| 1217 | return remote.FetchContext(ctx, o) |
| 1218 | } |
| 1219 | |
| 1220 | // Push performs a push to the remote. Returns NoErrAlreadyUpToDate if |
| 1221 | // the remote was already up-to-date, from the remote named as |