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

Method DeleteRemote

repository.go:667–679  ·  view source on GitHub ↗

DeleteRemote delete a remote from the repository and delete the config

(name string)

Source from the content-addressed store, hash-verified

665
666// DeleteRemote delete a remote from the repository and delete the config
667func (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
682func (r *Repository) Branch(name string) (*config.Branch, error) {

Callers 2

TestDeleteRemoteMethod · 0.80
mainFunction · 0.80

Calls 2

ConfigMethod · 0.95
SetConfigMethod · 0.65

Tested by 1

TestDeleteRemoteMethod · 0.64