MCPcopy Index your code
hub / github.com/go-git/go-git / DeleteRemote

Method DeleteRemote

repository.go:674–686  ·  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

672
673// DeleteRemote delete a remote from the repository and delete the config
674func (r *Repository) DeleteRemote(name string) error {
675 cfg, err := r.Config()
676 if err != nil {
677 return err
678 }
679
680 if _, ok := cfg.Remotes[name]; !ok {
681 return ErrRemoteNotFound
682 }
683
684 delete(cfg.Remotes, name)
685 return r.Storer.SetConfig(cfg)
686}
687
688// Branch return a Branch if exists
689func (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