Browse Source

Merge branch 'tr/test-lint-no-export-assignment-in-shell' into maint

* tr/test-lint-no-export-assignment-in-shell:
  test-lint: detect 'export FOO=bar'
  t9902: fix 'test A == B' to use = operator
maint
Junio C Hamano 12 years ago
parent
commit
98aa2eabf0
  1. 1
      t/check-non-portable-shell.pl
  2. 2
      t/t9902-completion.sh

1
t/check-non-portable-shell.pl

@ -21,6 +21,7 @@ while (<>) { @@ -21,6 +21,7 @@ while (<>) {
/^\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;
}

2
t/t9902-completion.sh

@ -69,7 +69,7 @@ run_completion () @@ -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
}

Loading…
Cancel
Save