aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2010-01-14 06:54:40 +0100
committerJunio C Hamano <gitster@pobox.com>2010-01-14 00:27:56 -0800
commit1d621fea180e2612facb190b758bf03dc79e4423 (patch)
treed6f85e3d953a981ac1d55b3637dadff0f7818f8f
parent234b3dae2fe83ae7df2c82194cd5f5eb01fd166d (diff)
downloadgit-1d621fea180e2612facb190b758bf03dc79e4423.tar.gz
git-1d621fea180e2612facb190b758bf03dc79e4423.tar.xz
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>
-rwxr-xr-xgit-rebase--interactive.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 55c451ade..db10dd7b2 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -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)