summaryrefslogtreecommitdiffstats
path: root/t
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 /t
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 't')
-rwxr-xr-xt/t5510-fetch.sh2
1 files changed, 0 insertions, 2 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 2467027d34..5c96591b9e 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -124,7 +124,6 @@ test_expect_success "fetch test followRemoteHEAD warn no change" '
git fetch >output &&
echo "${SQ}HEAD${SQ} at ${SQ}origin${SQ} is ${SQ}main${SQ}," \
"but we have ${SQ}other${SQ} locally." >expect &&
- echo "Run ${SQ}git remote set-head origin main${SQ} to follow the change." >>expect &&
test_cmp expect output &&
head=$(git rev-parse refs/remotes/origin/HEAD) &&
branch=$(git rev-parse refs/remotes/origin/other) &&
@@ -161,7 +160,6 @@ test_expect_success "fetch test followRemoteHEAD warn detached" '
echo "${SQ}HEAD${SQ} at ${SQ}origin${SQ} is ${SQ}main${SQ}," \
"but we have a detached HEAD pointing to" \
"${SQ}${HEAD}${SQ} locally." >expect &&
- echo "Run ${SQ}git remote set-head origin main${SQ} to follow the change." >>expect &&
test_cmp expect output
)
'