Merge branch 'tr/test-lint-no-export-assignment-in-shell'
authorJunio C Hamano <gitster@pobox.com>
Fri, 12 Jul 2013 19:04:16 +0000 (12:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Jul 2013 19:04:16 +0000 (12:04 -0700)
* tr/test-lint-no-export-assignment-in-shell:
test-lint: detect 'export FOO=bar'
t9902: fix 'test A == B' to use = operator

t/check-non-portable-shell.pl
t/t9902-completion.sh
index 8b5a71dc05216dc0acfb7761a4b9ca789c716ce0..45971f43b77142fe1bb90262974c83c786cfe43d 100755 (executable)
@@ -21,6 +21,7 @@ sub err {
        /^\s*declare\s+/ and err 'arrays/declare not portable';
        /^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
        /test\s+[^=]*==/ and err '"test a == b" is not portable (please use =)';
+       /^\s*export\s+[^=]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && export FOO)';
        # this resets our $. for each file
        close ARGV if eof;
 }
index d9e3103af597ec1f21ea56ca18500fbfcc8c2563..272a071e85b0b7c6b34da06fd7492a257b09fa52 100755 (executable)
@@ -69,7 +69,7 @@ run_completion ()
        local -a COMPREPLY _words
        local _cword
        _words=( $1 )
-       test "${1: -1}" == ' ' && _words+=('')
+       test "${1: -1}" = ' ' && _words+=('')
        (( _cword = ${#_words[@]} - 1 ))
        __git_wrap__git_main && print_comp
 }