diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2007-07-21 18:09:41 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-21 16:04:13 -0700 |
commit | 6368f3f8e701cb080b83ceb8ee622636046c514c (patch) | |
tree | f24c58d52d2c10380763e5e036fc2ff89ed3a829 /t/t3404-rebase-interactive.sh | |
parent | e1abc69b72401c5b2eb0e402e0fe10e8e0e5db27 (diff) | |
download | git-6368f3f8e701cb080b83ceb8ee622636046c514c.tar.gz git-6368f3f8e701cb080b83ceb8ee622636046c514c.tar.xz |
rebase -i: call editor just once for a multi-squash
Sometimes you want to squash more than two commits. Before this patch,
the editor was fired up for each squash command. Now the editor is
started only with the last squash command.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 43a6675ca..8206436cc 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -65,6 +65,7 @@ cat > fake-editor.sh << EOF #!/bin/sh test "\$1" = .git/COMMIT_EDITMSG && { test -z "\$FAKE_COMMIT_MESSAGE" || echo "\$FAKE_COMMIT_MESSAGE" > "\$1" + test -z "\$FAKE_COMMIT_AMEND" || echo "\$FAKE_COMMIT_AMEND" >> "\$1" exit } test -z "\$FAKE_LINES" && exit @@ -212,4 +213,12 @@ test_expect_success 'verbose flag is heeded, even after --continue' ' grep "^ file1 | 2 +-$" output ' +test_expect_success 'multi-squash only fires up editor once' ' + base=$(git rev-parse HEAD~4) && + FAKE_COMMIT_AMEND="ONCE" FAKE_LINES="1 squash 2 squash 3 squash 4" \ + git rebase -i $base && + test $base = $(git rev-parse HEAD^) && + test 1 = $(git show | grep ONCE | wc -l) +' + test_done |