]> git.ipfire.org Git - thirdparty/git.git/commit
fetch set_head: move warn advice into advise_if_enabled
authorBence Ferdinandy <bence@ferdinandy.com>
Thu, 5 Dec 2024 12:16:20 +0000 (13:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Dec 2024 17:59:16 +0000 (02:59 +0900)
commitad739f525eec917198887055f1a815e78d7c66be
tree78701fafadcc1edafc3a3292fa771c36166c39db
parentb7f7d16562c3c5af31d77254577e4afe9bf3e99a
fetch set_head: move warn advice into advise_if_enabled

Advice about what to do when getting a warning is typed out explicitly
twice and is printed as regular output. The output is also tested for.
Extract the advice message into a single place and use a wrapper
function, so if later the advice is made more chatty the signature only
needs to be changed in once place. Remove the testing for the advice
output in the tests.

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