@matheusbsbs / matheus-bagliano / commits / 1d621fea18
Fork 0

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>

Michael Haggerty committed Jan 14, 2010 at 06:54 UTC 1d621fea180e2612facb190b758bf03dc79e4423
1 file changed +2 -1
git-rebase--interactive.sh
+2 -1
@@ -164,7 +164,8 @@ pick_one () {
164 parent_sha1=$(git rev-parse --verify $sha1^) ||
165 die "Could not get the parent of $sha1"
166 current_sha1=$(git rev-parse --verify HEAD)
167 - if test "$no_ff$current_sha1" = "$parent_sha1"; then
167 + if test -z "$no_ff" -a "$current_sha1" = "$parent_sha1"
168 + then
169 output git reset --hard $sha1
170 test "a$1" = a-n && output git reset --soft $current_sha1
171 sha1=$(git rev-parse --short $sha1)