summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-10 00:25:46 +0200
committerJunio C Hamano <gitster@pobox.com>2019-07-10 00:25:46 +0200
commitcde9a64ea35ceeaa5e8dd2da2662445510fe651c (patch)
tree9b4d154625ca23d792cda8f8a65419adcfba1fc7 /t
parentMerge branch 'jh/status-aheadbehind' (diff)
parentpull: add --[no-]show-forced-updates passthrough (diff)
downloadgit-cde9a64ea35ceeaa5e8dd2da2662445510fe651c.tar.xz
git-cde9a64ea35ceeaa5e8dd2da2662445510fe651c.zip
Merge branch 'ds/fetch-disable-force-notice'
"git fetch" and "git pull" reports when a fetch results in non-fast-forward updates to let the user notice unusual situation. The commands learned "--no-shown-forced-updates" option to disable this safety feature. * ds/fetch-disable-force-notice: pull: add --[no-]show-forced-updates passthrough fetch: warn about forced updates in branch listing fetch: add --[no-]show-forced-updates argument
Diffstat (limited to 't')
-rwxr-xr-xt/t5510-fetch.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index e98d90dd9b..139f7106f7 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -978,4 +978,27 @@ test_expect_success '--negotiation-tip limits "have" lines sent with HTTP protoc
check_negotiation_tip
'
+test_expect_success '--no-show-forced-updates' '
+ mkdir forced-updates &&
+ (
+ cd forced-updates &&
+ git init &&
+ test_commit 1 &&
+ test_commit 2
+ ) &&
+ git clone forced-updates forced-update-clone &&
+ git clone forced-updates no-forced-update-clone &&
+ git -C forced-updates reset --hard HEAD~1 &&
+ (
+ cd forced-update-clone &&
+ git fetch --show-forced-updates origin 2>output &&
+ test_i18ngrep "(forced update)" output
+ ) &&
+ (
+ cd no-forced-update-clone &&
+ git fetch --no-show-forced-updates origin 2>output &&
+ ! test_i18ngrep "(forced update)" output
+ )
+'
+
test_done