MCPcopy Index your code
hub / github.com/go-git/go-git / FetchContext

Method FetchContext

repository.go:1207–1218  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1205// operation is complete, an error is returned. The context only affects the
1206// transport operations.
1207func (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

Callers 1

FetchMethod · 0.95

Calls 2

RemoteMethod · 0.95
ValidateMethod · 0.45

Tested by

no test coverage detected