[PATCH 0/2] Let `git remote add` play nicer with url.<url>.insteadOf
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 22, 2014, 17:06 UTC
- Message-ID
- <cover.1419267895.git.johannes.schindelin@gmx.de>
- In-Reply-To
- <20141216021900.50095.24877@random.io>
Anastas Dancha reported that it is not possible to add a remote when there is already a url.<url>.insteadOf = <nick> setting in $HOME/.gitconfig.
While it makes sense to prevent surprises when a user adds a remote and it fetches from somewhere completely different, it makes less sense to prevent adding a remote when it is actually the same that was specified in the config.
Therefore we add just another check that let's `git remote add` continue when the "existing" remote's URL is identical to the specified one.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Johannes Schindelin (2): git remote add: allow re-adding remotes with the same URL Add a regression test for 'git remote add <existing> <same-url>'
builtin/remote.c | 3 ++- t/t5505-remote.sh | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-)
-- 2.0.0.rc3.9669.g840d1f9