• J
    git remote: allow adding remotes agreeing with url.<...>.insteadOf · fb86e32d
    Johannes Schindelin 提交于
    When adding a remote, we make sure that the remote does not exist
    already. However, this test was not quite correct: when the
    url.<...>.insteadOf config variable was set to the remote name to be
    added, the code would assume that the remote exists already.
    
    Let's allow adding remotes when there is a url.<...>.insteadOf setting
    when both the name and the URL agree with the remote to be added.
    
    It might seem like a mistake to compare against remote->url[0] without
    verifying that remote->url_nr >=1, but at this point a missing URL has
    been filled by the name already, therefore url_nr cannot be zero.
    
    Noticed by Anastas Dancha.
    Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    fb86e32d
remote.c 44.0 KB