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
This commit is contained in:
commit
c7372c9e2c
@ -46,7 +46,7 @@ while (<>) {
|
|||||||
/(?:\$\(seq|^\s*seq\b)/ and err 'seq is not portable (use test_seq)';
|
/(?:\$\(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)';
|
/\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)';
|
/\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"';
|
err '"FOO=bar shell_func" assignment extends beyond "shell_func"';
|
||||||
$line = '';
|
$line = '';
|
||||||
# this resets our $. for each file
|
# this resets our $. for each file
|
||||||
|
@ -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
|
# The ref advertisement itself is filtered when protocol v2 is used, so
|
||||||
# use v0.
|
# 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_sent c5 c4^ c2side &&
|
||||||
have_not_sent c4 c4^^ c4^^^
|
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_commit -C server commit-on-b1 &&
|
||||||
|
|
||||||
test_config -C client fetch.negotiationalgorithm skipping &&
|
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 &&
|
grep " fetch" trace &&
|
||||||
|
|
||||||
# fetch-pack sends 2 requests each containing 16 "have" lines before
|
# fetch-pack sends 2 requests each containing 16 "have" lines before
|
||||||
|
Loading…
Reference in New Issue
Block a user