]> asedeno.scripts.mit.edu Git - git.git/commitdiff
rebase -i: Make the condition for an "if" more transparent
authorMichael Haggerty <mhagger@alum.mit.edu>
Thu, 14 Jan 2010 05:54:40 +0000 (06:54 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Jan 2010 08:27:56 +0000 (00:27 -0800)
Test $no_ff separately rather than testing it indirectly by gluing it
onto a comparison of two SHA1s.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--interactive.sh

index 55c451ade4aeb4edd09faeaa16d94353707a23fb..db10dd7b296db75906760adb7417cf6681d3cea0 100755 (executable)
@@ -164,7 +164,8 @@ pick_one () {
        parent_sha1=$(git rev-parse --verify $sha1^) ||
                die "Could not get the parent of $sha1"
        current_sha1=$(git rev-parse --verify HEAD)
-       if test "$no_ff$current_sha1" = "$parent_sha1"; then
+       if test -z "$no_ff" -a "$current_sha1" = "$parent_sha1"
+       then
                output git reset --hard $sha1
                test "a$1" = a-n && output git reset --soft $current_sha1
                sha1=$(git rev-parse --short $sha1)