summaryrefslogtreecommitdiffstats
path: root/advice.c
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-12-05 13:16:20 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-05 18:59:16 +0100
commitad739f525eec917198887055f1a815e78d7c66be (patch)
tree78701fafadcc1edafc3a3292fa771c36166c39db /advice.c
parentfetch: add configuration for set_head behaviour (diff)
downloadgit-ad739f525eec917198887055f1a815e78d7c66be.tar.xz
git-ad739f525eec917198887055f1a815e78d7c66be.zip
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>
Diffstat (limited to 'advice.c')
-rw-r--r--advice.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/advice.c b/advice.c
index 6b879d805c..66461fdce9 100644
--- a/advice.c
+++ b/advice.c
@@ -53,6 +53,7 @@ static struct {
[ADVICE_COMMIT_BEFORE_MERGE] = { "commitBeforeMerge" },
[ADVICE_DETACHED_HEAD] = { "detachedHead" },
[ADVICE_DIVERGING] = { "diverging" },
+ [ADVICE_FETCH_SET_HEAD_WARN] = { "fetchRemoteHEADWarn" },
[ADVICE_FETCH_SHOW_FORCED_UPDATES] = { "fetchShowForcedUpdates" },
[ADVICE_FORCE_DELETE_BRANCH] = { "forceDeleteBranch" },
[ADVICE_GRAFT_FILE_DEPRECATED] = { "graftFileDeprecated" },