1
0
mirror of https://github.com/git/git.git synced 2024-09-27 00:32:13 +02:00

rebase -i: Make the condition for an "if" more transparent

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>
This commit is contained in:
Michael Haggerty 2010-01-14 06:54:40 +01:00 committed by Junio C Hamano
parent 234b3dae2f
commit 1d621fea18

View File

@ -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)