MCPcopy
hub / github.com/go-git/go-git / CreateRemoteAnonymous

Method CreateRemoteAnonymous

repository.go:659–671  ·  view source on GitHub ↗

CreateRemoteAnonymous creates a new anonymous remote. c.Name must be "anonymous". It's used like 'git fetch git@github.com:src-d/go-git.git master:master'.

(c *config.RemoteConfig)

Source from the content-addressed store, hash-verified

657// CreateRemoteAnonymous creates a new anonymous remote. c.Name must be "anonymous".
658// It's used like 'git fetch git@github.com:src-d/go-git.git master:master'.
659func (r *Repository) CreateRemoteAnonymous(c *config.RemoteConfig) (*Remote, error) {
660 if err := c.Validate(); err != nil {
661 return nil, err
662 }
663
664 if c.Name != "anonymous" {
665 return nil, ErrAnonymousRemoteName
666 }
667
668 remote := NewRemote(r.Storer, c)
669
670 return remote, nil
671}
672
673// DeleteRemote delete a remote from the repository and delete the config
674func (r *Repository) DeleteRemote(name string) error {

Calls 2

NewRemoteFunction · 0.85
ValidateMethod · 0.45