From 944019c8b3896ff8d169864096eedc60155c80a4 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Thu, 15 Jan 2009 14:03:17 +0100 Subject: t3501: check that commits are actually done The basic idea of t3501 is to check whether revert and cherry-pick works on renamed files. But as there is no pure cherry-pick/revert test, it is good to also check if commits are actually done in that scenario. Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh index 6da2128..bb4cf00 100755 --- a/t/t3501-revert-cherry-pick.sh +++ b/t/t3501-revert-cherry-pick.sh @@ -45,6 +45,7 @@ test_expect_success 'cherry-pick after renaming branch' ' git checkout rename2 && git cherry-pick added && + test $(git rev-parse HEAD^) = $(git rev-parse rename2) && test -f opos && grep "Add extra line at the end" opos @@ -54,6 +55,7 @@ test_expect_success 'revert after renaming branch' ' git checkout rename1 && git revert added && + test $(git rev-parse HEAD^) = $(git rev-parse rename1) && test -f spoo && ! grep "Add extra line at the end" spoo -- cgit v0.10.2-6-g49f6 From dc7f55cbe9a544ba7af981c00c52efb2d0283a8f Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Thu, 15 Jan 2009 13:56:15 +0100 Subject: t3404: Add test case for aborted --continue after "edit" Add a test case for the bugfix introduced by commit 8beb1f33d "git-rebase-interactive: do not squash commits on abort". Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 7d10a27..1182b46 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -373,6 +373,21 @@ test_expect_success '--continue tries to commit, even for "edit"' ' test $parent = $(git rev-parse HEAD^) ' +test_expect_success 'aborted --continue does not squash commits after "edit"' ' + old=$(git rev-parse HEAD) && + test_tick && + FAKE_LINES="edit 1" git rebase -i HEAD^ && + echo "edited again" > file7 && + git add file7 && + ( + FAKE_COMMIT_MESSAGE=" " && + export FAKE_COMMIT_MESSAGE && + test_must_fail git rebase --continue + ) && + test $old = $(git rev-parse HEAD) && + git rebase --abort +' + test_expect_success 'rebase a detached HEAD' ' grandparent=$(git rev-parse HEAD~2) && git checkout $(git rev-parse HEAD) && -- cgit v0.10.2-6-g49f6 From f8aa1b6902d7a77c26b0ef615c9070bbed4be5c4 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Thu, 15 Jan 2009 13:56:16 +0100 Subject: t3404: Add test case for auto-amending only edited commits after "edit" Add a test case for the bugfix introduced by commit c14c3c82d "git-rebase--interactive: auto amend only edited commit". Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 1182b46..2cc8e7a 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -388,6 +388,23 @@ test_expect_success 'aborted --continue does not squash commits after "edit"' ' git rebase --abort ' +test_expect_success 'auto-amend only edited commits after "edit"' ' + test_tick && + FAKE_LINES="edit 1" git rebase -i HEAD^ && + echo "edited again" > file7 && + git add file7 && + FAKE_COMMIT_MESSAGE="edited file7 again" git commit && + echo "and again" > file7 && + git add file7 && + test_tick && + ( + FAKE_COMMIT_MESSAGE="and again" && + export FAKE_COMMIT_MESSAGE && + test_must_fail git rebase --continue + ) && + git rebase --abort +' + test_expect_success 'rebase a detached HEAD' ' grandparent=$(git rev-parse HEAD~2) && git checkout $(git rev-parse HEAD) && -- cgit v0.10.2-6-g49f6