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

Method CreateRemoteAnonymous

repository.go:652–664  ·  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

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

Calls 2

NewRemoteFunction · 0.85
ValidateMethod · 0.45