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