]> git.ipfire.org Git - thirdparty/git.git/commit
remote set-head: better output for --auto
authorBence Ferdinandy <bence@ferdinandy.com>
Fri, 22 Nov 2024 12:28:47 +0000 (13:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Nov 2024 02:46:36 +0000 (11:46 +0900)
commitdfe86fa06bdc46f1e5bf1f55e8571bb9a088d20c
tree97e083caff70c0d586c156153af603b2999e192f
parent4f07c45e25810700cec57c6b01ca9ff97bfb6840
remote set-head: better output for --auto

Currently, set-head --auto will print a message saying "remote/HEAD set
to branch", which implies something was changed.

Change the output of --auto, so the output actually reflects what was
done: a) set a previously unset HEAD, b) change HEAD because remote
changed or c) no updates. As edge cases, if HEAD is changed from
a previous symbolic reference that was not a remote branch, explicitly
call attention to this fact, and also notify the user if the previous
reference was not a symbolic reference.

Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/remote.c
t/t5505-remote.sh