DeleteRemote delete a remote from the repository and delete the config
(name string)
| 665 | |
| 666 | // DeleteRemote delete a remote from the repository and delete the config |
| 667 | func (r *Repository) DeleteRemote(name string) error { |
| 668 | cfg, err := r.Config() |
| 669 | if err != nil { |
| 670 | return err |
| 671 | } |
| 672 | |
| 673 | if _, ok := cfg.Remotes[name]; !ok { |
| 674 | return ErrRemoteNotFound |
| 675 | } |
| 676 | |
| 677 | delete(cfg.Remotes, name) |
| 678 | return r.Storer.SetConfig(cfg) |
| 679 | } |
| 680 | |
| 681 | // Branch return a Branch if exists |
| 682 | func (r *Repository) Branch(name string) (*config.Branch, error) { |