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 <trast@inf.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast committed
Jul 8, 2013 at 17:20 UTC
9968ffff0d09b4925f339cceafb5f7e7cd78fb02
1 file changed
+1
t/check-non-portable-shell.pl
+1
@@ -21,6 +21,7 @@ while (<>) {
21
/^\s*declare\s+/ and err 'arrays/declare not portable';
22
/^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
23
/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)';
25
# this resets our $. for each file
26
close ARGV if eof;
27
}