Don't overwrite repo entries when checking for trailing slashes

Signed-off-by: Dominik Braun <mail@dominikbraun.io>
pull/9095/head
Dominik Braun 3 years ago
parent d4c250f508
commit 433c3d8d14

@ -160,10 +160,8 @@ func (o *repoAddOptions) run(out io.Writer) error {
// 2. When the config is different require --force-update
if !o.forceUpdate && f.Has(o.name) {
existing := f.Get(o.name)
existing.URL = existing.URLWithTrailingSlash()
c.URL = c.URLWithTrailingSlash()
// Only fail with an error if the configs are different.
if c != *existing {
if c.URLWithTrailingSlash() != existing.URLWithTrailingSlash() {
return errors.Errorf("repository name (%s) already exists, please specify a different name", o.name)
}

Loading…
Cancel
Save