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

Method Remotes

repository.go:612–627  ·  view source on GitHub ↗

Remotes returns a list with all the remotes

()

Source from the content-addressed store, hash-verified

610
611// Remotes returns a list with all the remotes
612func (r *Repository) Remotes() ([]*Remote, error) {
613 cfg, err := r.Config()
614 if err != nil {
615 return nil, err
616 }
617
618 remotes := make([]*Remote, len(cfg.Remotes))
619
620 var i int
621 for _, c := range cfg.Remotes {
622 remotes[i] = NewRemote(r.Storer, c)
623 i++
624 }
625
626 return remotes, nil
627}
628
629// CreateRemote creates a new remote
630func (r *Repository) CreateRemote(c *config.RemoteConfig) (*Remote, error) {

Callers 12

TestCloneMethod · 0.80
TestCloneWithTagsMethod · 0.80
TestPlainCloneMethod · 0.80
TestFetchMethod · 0.80
TestCloneDeepMethod · 0.80
TestCloneSingleBranchMethod · 0.80
RepositoryMethod · 0.80
mainFunction · 0.80

Calls 2

ConfigMethod · 0.95
NewRemoteFunction · 0.85

Tested by 10

TestCloneMethod · 0.64
TestCloneWithTagsMethod · 0.64
TestPlainCloneMethod · 0.64
TestFetchMethod · 0.64
TestCloneDeepMethod · 0.64
TestCloneSingleBranchMethod · 0.64