threads / patch / 30565

patcht3404: begin "exchange commits with -p" test with correct preconditions

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

## tl;dr

2 messages between May 19, 2012 and May 19, 2012. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Johannes Sixt· May 19, 2012, 13:14 UTC · lore

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(+)
Show changes to t/t3404-rebase-interactive.sh +1 −0
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
Jonathan Nieder· May 19, 2012, 22:15 UTC · re: Johannes Sixt · lore

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

Johannes Sixt wrote:
Show 8 quoted lines
> 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?

Yeah, looks like it was always broken. I remember sanity checking by removing the "-p", too, but that was probably before moving the test to join the other -p tests. Thanks for fixing it.

Acked-by: Jonathan Nieder <jrnieder@gmail.com>

← back to recent threads