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>
Jeff King committed
May 14, 2008 at 00:01 UTC
bbf08124e0a87658a76b53a05d67227fa3b4e7b9
5 files changed
+8
-8
git-rebase.sh
+1
-1
@@ -353,7 +353,7 @@ orig_head=$branch
353
mb=$(git merge-base "$onto" "$branch")
354
if test "$upstream" = "$onto" && test "$mb" = "$onto" &&
355
# linear history?
356
- ! git rev-list --parents "$onto".."$branch" | grep " .* " > /dev/null
356
+ ! (git rev-list --parents "$onto".."$branch" | grep " .* ") > /dev/null
357
then
358
# Lazily switch to the target branch if needed...
359
test -z "$switch_to" || git checkout "$switch_to"
t/t3400-rebase.sh
+2
-2
@@ -44,13 +44,13 @@ test_expect_success 'rebase against master' '
44
45
test_expect_success \
46
'the rebase operation should not have destroyed author information' \
47
- '! git log | grep "Author:" | grep "<>"'
47
+ '! (git log | grep "Author:" | grep "<>")'
48
49
test_expect_success 'rebase after merge master' '
50
git reset --hard topic &&
51
git merge master &&
52
git rebase master &&
53
- ! git show | grep "^Merge:"
53
+ ! (git show | grep "^Merge:")
54
'
55
56
test_expect_success 'rebase of history with merges is linearized' '
t/t3700-add.sh
+3
-3
@@ -81,17 +81,17 @@ test_expect_success '.gitignore test setup' '
81
82
test_expect_success '.gitignore is honored' '
83
git add . &&
84
- ! git ls-files | grep "\\.ig"
84
+ ! (git ls-files | grep "\\.ig")
85
'
86
87
test_expect_success 'error out when attempting to add ignored ones without -f' '
88
! git add a.?? &&
89
- ! git ls-files | grep "\\.ig"
89
+ ! (git ls-files | grep "\\.ig")
90
'
91
92
test_expect_success 'error out when attempting to add ignored ones without -f' '
93
! git add d.?? &&
94
- ! git ls-files | grep "\\.ig"
94
+ ! (git ls-files | grep "\\.ig")
95
'
96
97
test_expect_success 'add ignored ones with -f' '
t/t5302-pack-index.sh
+1
-1
@@ -65,7 +65,7 @@ test_expect_success \
65
66
have_64bits=
67
if msg=$(git verify-pack -v "test-3-${pack3}.pack" 2>&1) ||
68
- ! echo "$msg" | grep "pack too large .* off_t"
68
+ ! (echo "$msg" | grep "pack too large .* off_t")
69
then
70
have_64bits=t
71
else
t/t7501-commit.sh
+1
-1
@@ -41,7 +41,7 @@ test_expect_success \
41
test_expect_success \
42
"using paths with --interactive" \
43
"echo bong-o-bong >file &&
44
- ! echo 7 | git-commit -m foo --interactive file"
44
+ ! (echo 7 | git-commit -m foo --interactive file)"
45
46
test_expect_success \
47
"using invalid commit with -C" \