]> git.ipfire.org Git - thirdparty/git.git/commit
remote: allow resetting url list
authorJeff King <peff@peff.net>
Fri, 14 Jun 2024 10:31:22 +0000 (06:31 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Jun 2024 16:34:38 +0000 (09:34 -0700)
commit9badf97c42474df3f0474a851bdc2e62e59da403
treeca49a533faa022d695f1aedde428e54c10a73ad2
parentbd1b88dc7aedb44561559e88cde0dd7bad78e2ae
remote: allow resetting url list

Because remote.*.url is treated as a multi-valued key, there is no way
to override previous config. So for example if you have
remote.origin.url set to some wrong value, doing:

  git -c remote.origin.url=right fetch

would not work. It would append "right" to the list, which means we'd
still fetch from "wrong" (since subsequent values are used only as push
urls).

Let's provide a mechanism to reset the list, like we do for other
multi-valued keys (e.g., credential.helper, http.extraheaders, and
merge.suppressDest all use this "empty string means reset" pattern).

Reported-by: Mathew George <mathewegeorge@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/remote.txt
remote.c
t/t5505-remote.sh