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)
| 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'. |
| 652 | func (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 |
| 667 | func (r *Repository) DeleteRemote(name string) error { |