git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] t3404: Add test case for auto-amending only edited commits after "edit"

From
Stephan Beyer <s-beyer@gmx.net>
Date
Jan 15, 2009, 12:56 UTC
Message-ID
<1232024176-16600-2-git-send-email-s-beyer@gmx.net>
In-Reply-To
<1232024176-16600-1-git-send-email-s-beyer@gmx.net>

Add a test case for the bugfix introduced by commit c14c3c82d "git-rebase--interactive: auto amend only edited commit".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
 t/t3404-rebase-interactive.sh |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
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) &&
-- 
1.6.1.160.gecdb
Previous: Stephan Beyer
Message 2 of 2 in “t3404: Add test case for aborted --continue after "edit"”
  1. 1/2 t3404: Add test case for aborted --continue after "edit"Stephan Beyer, Jan 15, 2009
  2. 2/2 t3404: Add test case for auto-amending only edited commits after "edit"Stephan Beyer, Jan 15, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.