cleanUpMigrateGitConfig removes mirror info which prevents "push --all". This also removes possible user credentials.
(configPath string)
| 887 | // cleanUpMigrateGitConfig removes mirror info which prevents "push --all". |
| 888 | // This also removes possible user credentials. |
| 889 | func cleanUpMigrateGitConfig(configPath string) error { |
| 890 | cfg, err := ini.Load(configPath) |
| 891 | if err != nil { |
| 892 | return errors.Newf("open config file: %v", err) |
| 893 | } |
| 894 | cfg.DeleteSection("remote \"origin\"") |
| 895 | if err = cfg.SaveToIndent(configPath, "\t"); err != nil { |
| 896 | return errors.Newf("save config file: %v", err) |
| 897 | } |
| 898 | return nil |
| 899 | } |
| 900 | |
| 901 | var hooksTpls = map[git.HookName]string{ |
| 902 | "pre-receive": "#!/usr/bin/env %s\n\"%s\" hook --config='%s' pre-receive\n", |
no outgoing calls
no test coverage detected