Skip to content

Commit c2058b2

Browse files
committed
Merge branch 'es/shell-check-updates'
Test script linter has been updated to catch an attempt to use one-shot export construct "VAR=VAL func" for shell functions (which does not work for some shells) better. * es/shell-check-updates: check-non-portable-shell: improve `VAR=val shell-func` detection check-non-portable-shell: suggest alternative for `VAR=val shell-func` check-non-portable-shell: loosen one-shot assignment error message t4034: fix use of one-shot variable assignment with shell function t3430: drop unnecessary one-shot "VAR=val shell-func" invocation
2 parents d70f320 + 7b9e547 commit c2058b2

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

t/check-non-portable-shell.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ sub err {
4949
/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (use FOO=bar && export FOO)';
5050
/\blocal\s+[A-Za-z0-9_]*=\$([A-Za-z0-9_{]|[(][^(])/ and
5151
err q(quote "$val" in 'local var=$val');
52-
/^\s*([A-Z0-9_]+=(\w*|(["']).*?\3)\s+)+(\w+)/ and exists($func{$4}) and
53-
err '"FOO=bar shell_func" assignment extends beyond "shell_func"';
52+
/\b([A-Z0-9_]+=(\w*|(["']).*?\3)\s+)+(\w+)/ and !/test_env.+=/ and exists($func{$4}) and
53+
err '"FOO=bar shell_func" is not portable (use test_env FOO=bar shell_func)';
5454
$line = '';
5555
# this resets our $. for each file
5656
close ARGV if eof;

t/t3430-rebase-merges.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,7 @@ test_expect_success 'refuse to merge ancestors of HEAD' '
392392

393393
test_expect_success 'root commits' '
394394
git checkout --orphan unrelated &&
395-
(GIT_AUTHOR_NAME="Parsnip" GIT_AUTHOR_EMAIL="[email protected]" \
396-
test_commit second-root) &&
395+
test_commit --author "Parsnip <[email protected]>" second-root &&
397396
test_commit third-root &&
398397
cat >script-from-scratch <<-\EOF &&
399398
pick third-root

t/t4034-diff-words.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ test_language_driver () {
7070
word_diff --color-words
7171
'
7272
test_expect_success "diff driver '$lang' in Islandic" '
73-
LANG=is_IS.UTF-8 LANGUAGE=is LC_ALL="$is_IS_locale" \
73+
test_env LANG=is_IS.UTF-8 LANGUAGE=is LC_ALL="$is_IS_locale" \
7474
word_diff --color-words
7575
'
7676
}

0 commit comments

Comments
 (0)