summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-01-14 12:29:47 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-01-14 12:29:47 -0800
commit7fd92d9ed0255faf64ed78f02eadc902c7824008 (patch)
tree0d5eaf6c14aa0d0606f94253b8ff4de8a8c852a6 /builtin
parentGit 2.3.0-rc0 (diff)
parentAdd a regression test for 'git remote add <existing> <same-url>' (diff)
downloadtgif-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 46ecfd9f7b..b4ff468977 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);