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

Method FetchContext

repository.go:1198–1209  ·  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

1196// operation is complete, an error is returned. The context only affects the
1197// transport operations.
1198func (r *Repository) FetchContext(ctx context.Context, o *FetchOptions) error {
1199 if err := o.Validate(); err != nil {
1200 return err
1201 }
1202
1203 remote, err := r.Remote(o.RemoteName)
1204 if err != nil {
1205 return err
1206 }
1207
1208 return remote.FetchContext(ctx, o)
1209}
1210
1211// Push performs a push to the remote. Returns NoErrAlreadyUpToDate if
1212// 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