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

[PATCH] t3404: begin "exchange commits with -p" test with correct preconditions

From
Johannes Sixt <j6t@kdbg.org>
Date
May 19, 2012, 13:14 UTC
Message-ID
<4FB79CA8.7080103@kdbg.org>

The test case shows a bug in 'rebase -p', but even if the bug were fixed the test would fail because it did not ensure that the preconditions match the postconditions that were checked. Insert the suitable 'git checkout'.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 Could it be that this bug existed since the test case was introduced
 in cddb42d2?
 (The bug in git-rebase has not been fixed since then, unfortunately.)
 -- Hannes
 t/t3404-rebase-interactive.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 4983bd7..025c1c6 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -247,6 +247,7 @@ test_expect_success '-p handles "no changes" gracefully' '
 '
 
 test_expect_failure 'exchange two commits with -p' '
+	git checkout H &&
 	FAKE_LINES="2 1" git rebase -i -p HEAD~2 &&
 	test H = $(git cat-file commit HEAD^ | sed -ne \$p) &&
 	test G = $(git cat-file commit HEAD | sed -ne \$p)
-- 
1.7.10.2.529.g0c18cfd
Next: Jonathan Nieder
Message 1 of 2 in “t3404: begin "exchange commits with -p" test with correct preconditions”
  1. t3404: begin "exchange commits with -p" test with correct preconditionsJohannes Sixt, May 19, 2012
  2. Jonathan NiederMay 19, 2012

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.