aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-01-14 12:29:47 -0800
committerJunio C Hamano <gitster@pobox.com>2015-01-14 12:29:47 -0800
commit7fd92d9ed0255faf64ed78f02eadc902c7824008 (patch)
tree0d5eaf6c14aa0d0606f94253b8ff4de8a8c852a6 /builtin
parentaddfb21a94fb4e6b9d07b270f7bb3748767a8f38 (diff)
parentb90c95d90ed9e96a0c1515c00fa8c0f92a0cb130 (diff)
downloadgit-7fd92d9ed0255faf64ed78f02eadc902c7824008.tar.gz
git-7fd92d9ed0255faf64ed78f02eadc902c7824008.tar.xz
Merge branch 'js/remote-add-with-insteadof'
"git remote add $name $URL" is now allowed when "url.$URL.insteadOf" is already defined. * js/remote-add-with-insteadof: Add a regression test for 'git remote add <existing> <same-url>' git remote: allow adding remotes agreeing with url.<...>.insteadOf
Diffstat (limited to 'builtin')
-rw-r--r--builtin/remote.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index 46ecfd9f7..b4ff46897 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -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);