diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2007-07-24 21:43:09 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-27 10:59:42 -0700 |
commit | fb47cfbd59b12ea67e1a5c6a9d0bd665fcae4581 (patch) | |
tree | ee9bd166d2cbc97374b99b22fe1cabc8a7eaba5f /t | |
parent | 7ab3cc70a6aad2e4f8ccaa98e5520aa126eaef8f (diff) | |
download | git-fb47cfbd59b12ea67e1a5c6a9d0bd665fcae4581.tar.gz git-fb47cfbd59b12ea67e1a5c6a9d0bd665fcae4581.tar.xz |
rebase -i: fix interrupted squashing
When a squashing merge failed, the first commit would not be replaced,
due to "git reset --soft" being called with an unmerged index.
Noticed by Uwe Kleine-König.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 8206436cc..817f614cd 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -221,4 +221,34 @@ test_expect_success 'multi-squash only fires up editor once' ' test 1 = $(git show | grep ONCE | wc -l) ' +test_expect_success 'squash works as expected' ' + for n in one two three four + do + echo $n >> file$n && + git add file$n && + git commit -m $n + done && + one=$(git rev-parse HEAD~3) && + FAKE_LINES="1 squash 3 2" git rebase -i HEAD~3 && + test $one = $(git rev-parse HEAD~2) +' + +test_expect_success 'interrupted squash works as expected' ' + for n in one two three four + do + echo $n >> conflict && + git add conflict && + git commit -m $n + done && + one=$(git rev-parse HEAD~3) && + ! FAKE_LINES="1 squash 3 2" git rebase -i HEAD~3 && + (echo one; echo two; echo four) > conflict && + git add conflict && + ! git rebase --continue && + echo resolved > conflict && + git add conflict && + git rebase --continue && + test $one = $(git rev-parse HEAD~2) +' + test_done |