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

Method Remote

repository.go:604–616  ·  view source on GitHub ↗

Remote return a remote if exists

(name string)

Source from the content-addressed store, hash-verified

602
603// Remote return a remote if exists
604func (r *Repository) Remote(name string) (*Remote, error) {
605 cfg, err := r.Config()
606 if err != nil {
607 return nil, err
608 }
609
610 c, ok := cfg.Remotes[name]
611 if !ok {
612 return nil, ErrRemoteNotFound
613 }
614
615 return NewRemote(r.Storer, c), nil
616}
617
618// Remotes returns a list with all the remotes
619func (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