summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-01-30 14:17:09 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-01-30 14:17:09 -0800
commitc7372c9e2c11fa0adbfef2b9c5e5ba4ce19eb688 (patch)
tree077375f1d3b849071e2700418255c5141e10781f /t
parentMerge branch 'hi/gpg-mintrustlevel' (diff)
parentfetch test: mark test of "skipping" haves as v0-only (diff)
downloadtgif-c7372c9e2c11fa0adbfef2b9c5e5ba4ce19eb688.tar.xz
Merge branch 'jn/test-lint-one-shot-export-to-shell-function'
The test-lint machinery knew to check "VAR=VAL shell_function" construct, but did not check "VAR= shell_funciton", which has been corrected. * jn/test-lint-one-shot-export-to-shell-function: fetch test: mark test of "skipping" haves as v0-only t/check-non-portable-shell: detect "FOO= shell_func", too fetch test: avoid use of "VAR= cmd" with a shell function
Diffstat (limited to 't')
-rwxr-xr-xt/check-non-portable-shell.pl2
-rwxr-xr-xt/t5552-skipping-fetch-negotiator.sh18
2 files changed, 17 insertions, 3 deletions
diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl
index 38bfeebd88..fd3303552b 100755
--- a/t/check-non-portable-shell.pl
+++ b/t/check-non-portable-shell.pl
@@ -46,7 +46,7 @@ while (<>) {
/(?:\$\(seq|^\s*seq\b)/ and err 'seq is not portable (use test_seq)';
/\bgrep\b.*--file\b/ and err 'grep --file FILE is not portable (use grep -f FILE)';
/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (use FOO=bar && export FOO)';
- /^\s*([A-Z0-9_]+=(\w+|(["']).*?\3)\s+)+(\w+)/ and exists($func{$4}) and
+ /^\s*([A-Z0-9_]+=(\w*|(["']).*?\3)\s+)+(\w+)/ and exists($func{$4}) and
err '"FOO=bar shell_func" assignment extends beyond "shell_func"';
$line = '';
# this resets our $. for each file
diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh
index f70cbcc9ca..8f25f4b31f 100755
--- a/t/t5552-skipping-fetch-negotiator.sh
+++ b/t/t5552-skipping-fetch-negotiator.sh
@@ -107,7 +107,11 @@ test_expect_success 'use ref advertisement to filter out commits' '
# The ref advertisement itself is filtered when protocol v2 is used, so
# use v0.
- GIT_TEST_PROTOCOL_VERSION= trace_fetch client origin to_fetch &&
+ (
+ GIT_TEST_PROTOCOL_VERSION= &&
+ export GIT_TEST_PROTOCOL_VERSION &&
+ trace_fetch client origin to_fetch
+ ) &&
have_sent c5 c4^ c2side &&
have_not_sent c4 c4^^ c4^^^
'
@@ -169,7 +173,17 @@ test_expect_success 'do not send "have" with ancestors of commits that server AC
test_commit -C server commit-on-b1 &&
test_config -C client fetch.negotiationalgorithm skipping &&
- trace_fetch client "$(pwd)/server" to_fetch &&
+
+ # NEEDSWORK: The number of "have"s sent depends on whether the transport
+ # is stateful. If the overspecification of the result were reduced, this
+ # test could be used for both stateful and stateless transports.
+ (
+ # Force protocol v0, in which local transport is stateful (in
+ # protocol v2 it is stateless).
+ GIT_TEST_PROTOCOL_VERSION=0 &&
+ export GIT_TEST_PROTOCOL_VERSION &&
+ trace_fetch client "$(pwd)/server" to_fetch
+ ) &&
grep " fetch" trace &&
# fetch-pack sends 2 requests each containing 16 "have" lines before