From bbf08124e0a87658a76b53a05d67227fa3b4e7b9 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 14 May 2008 00:01:22 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- git-rebase.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-rebase.sh') diff --git a/git-rebase.sh b/git-rebase.sh index 9b13b833c..fbb0f288b 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -353,7 +353,7 @@ orig_head=$branch mb=$(git merge-base "$onto" "$branch") if test "$upstream" = "$onto" && test "$mb" = "$onto" && # linear history? - ! git rev-list --parents "$onto".."$branch" | grep " .* " > /dev/null + ! (git rev-list --parents "$onto".."$branch" | grep " .* ") > /dev/null then # Lazily switch to the target branch if needed... test -z "$switch_to" || git checkout "$switch_to" -- cgit v1.2.1