fix bsd shell negation

On some shells (notably /bin/sh on FreeBSD 6.1), the
construct

  foo && ! bar | baz

is true if

  foo && baz

whereas for most other shells (such as bash) is true if

  foo && ! baz

We can work around this by specifying

  foo && ! (bar | baz)

which works everywhere.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2008-05-14 00:01:22 -04:00
committed by Junio C Hamano
parent 64c0d71ce9
commit bbf08124e0
5 changed files with 8 additions and 8 deletions

View File

@ -81,17 +81,17 @@ test_expect_success '.gitignore test setup' '
test_expect_success '.gitignore is honored' '
git add . &&
! git ls-files | grep "\\.ig"
! (git ls-files | grep "\\.ig")
'
test_expect_success 'error out when attempting to add ignored ones without -f' '
! git add a.?? &&
! git ls-files | grep "\\.ig"
! (git ls-files | grep "\\.ig")
'
test_expect_success 'error out when attempting to add ignored ones without -f' '
! git add d.?? &&
! git ls-files | grep "\\.ig"
! (git ls-files | grep "\\.ig")
'
test_expect_success 'add ignored ones with -f' '