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

Method Remote

repository.go:597–609  ·  view source on GitHub ↗

Remote return a remote if exists

(name string)

Source from the content-addressed store, hash-verified

595
596// Remote return a remote if exists
597func (r *Repository) Remote(name string) (*Remote, error) {
598 cfg, err := r.Config()
599 if err != nil {
600 return nil, err
601 }
602
603 c, ok := cfg.Remotes[name]
604 if !ok {
605 return nil, ErrRemoteNotFound
606 }
607
608 return NewRemote(r.Storer, c), nil
609}
610
611// Remotes returns a list with all the remotes
612func (r *Repository) Remotes() ([]*Remote, error) {

Callers 15

FetchContextMethod · 0.95
PushContextMethod · 0.95
TestDeleteRemoteMethod · 0.80
TestPushPruneMethod · 0.80
TestPushNewReferenceMethod · 0.80

Calls 2

ConfigMethod · 0.95
NewRemoteFunction · 0.85