]> git.ipfire.org Git - thirdparty/git.git/commit - t/t5505-remote.sh
remote rename/remove: gently handle remote.pushDefault config
authorBert Wesarg <bert.wesarg@googlemail.com>
Sat, 1 Feb 2020 09:34:09 +0000 (10:34 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Feb 2020 18:52:10 +0000 (10:52 -0800)
commitb3fd6cbf29435f8b49a0a5d9f86236e00b084624
tree552b7f9bb784f8b0991126e93789a82393732c5a
parentf2a2327a4a6a9bccade6df2bed1fdc3a8ab37f4c
remote rename/remove: gently handle remote.pushDefault config

When renaming a remote with

    git remote rename X Y
    git remote remove X

Git already renames or removes any branch.<name>.remote and
branch.<name>.pushRemote configurations if their value is X.

However remote.pushDefault needs a more gentle approach, as this may be
set in a non-repo configuration file. In such a case only a warning is
printed, such as:

warning: The global configuration remote.pushDefault in:
$HOME/.gitconfig:35
now names the non-existent remote origin

It is changed to remote.pushDefault = Y or removed when set in a repo
configuration though.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/remote.c
t/t5505-remote.sh