Merge branch 'ld/p4-exclude-in-sync'
[gitweb.git] / builtin / remote.c
index 46ecfd9f7b0dd0b28169341d14132df376e509bc..b4ff4689770e402675faba2ce400150b4803a360 100644 (file)
@@ -180,7 +180,9 @@ static int add(int argc, const char **argv)
        url = argv[1];
 
        remote = remote_get(name);
-       if (remote && (remote->url_nr > 1 || strcmp(name, remote->url[0]) ||
+       if (remote && (remote->url_nr > 1 ||
+                       (strcmp(name, remote->url[0]) &&
+                               strcmp(url, remote->url[0])) ||
                        remote->fetch_refspec_nr))
                die(_("remote %s already exists."), name);