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

Method PushContext

repository.go:1234–1245  ·  view source on GitHub ↗

PushContext performs a push to the remote. Returns NoErrAlreadyUpToDate if the remote was already up-to-date, from the remote named as FetchOptions.RemoteName. The provided Context must be non-nil. If the context expires before the operation is complete, an error is returned. The context only affec

(ctx context.Context, o *PushOptions)

Source from the content-addressed store, hash-verified

1232// operation is complete, an error is returned. The context only affects the
1233// transport operations.
1234func (r *Repository) PushContext(ctx context.Context, o *PushOptions) error {
1235 if err := o.Validate(); err != nil {
1236 return err
1237 }
1238
1239 remote, err := r.Remote(o.RemoteName)
1240 if err != nil {
1241 return err
1242 }
1243
1244 return remote.PushContext(ctx, o)
1245}
1246
1247// Log returns the commit history from the given LogOptions.
1248func (r *Repository) Log(o *LogOptions) (object.CommitIter, error) {

Callers 1

PushMethod · 0.95

Calls 2

RemoteMethod · 0.95
ValidateMethod · 0.45

Tested by

no test coverage detected