Skip to content

Commit 9968fff

Browse files
Thomas Rastgitster
authored andcommitted
test-lint: detect 'export FOO=bar'
Some shells do not understand the one-line construct, and instead need FOO=bar && export FOO Detect this in the test-lint target. Signed-off-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 38678a1 commit 9968fff

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/check-non-portable-shell.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ sub err {
2121
/^\s*declare\s+/ and err 'arrays/declare not portable';
2222
/^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
2323
/test\s+[^=]*==/ and err '"test a == b" is not portable (please use =)';
24+
/^\s*export\s+[^=]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && export FOO)';
2425
# this resets our $. for each file
2526
close ARGV if eof;
2627
}

0 commit comments

Comments
 (0)