[07/12] t3427: fix another incorrect assumption
diff mbox series

Message ID f7452d3740fc6183256f2d2cd5435421d8743ea4.1564049474.git.gitgitgadget@gmail.com
State New
Headers show
Series
  • rebase -r: support merge strategies other than recursive
Related show

Commit Message

James Coglan via GitGitGadget July 25, 2019, 10:11 a.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

The test case that concerns `git rebase -Xsubtree` (with the
default rebase backend, not with `--preserve-merges`) starts out with a
pre-rebase commit history that begins with a commit that introduces
three files: master1.t, master2.t and master3.t.

This commit was generated by passing a subtree merge commit through `git
filter-branch --subdirectory-filter`, so it looks as if this commit
really introduces all those files.

The commit history onto which this commit is then rebased, however,
introduced those files in individual commits. For that reason, the
rebase will fail, it _must_ fail, because the first `pick` results in no
changes to be committed.

Let's fix the test case to expect exactly this situation.

With this change, we can mark the original bug that this test case tried
to demonstrate as fixed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t3427-rebase-subtree.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/t/t3427-rebase-subtree.sh b/t/t3427-rebase-subtree.sh
index b490919c60..c0ff3241e4 100755
--- a/t/t3427-rebase-subtree.sh
+++ b/t/t3427-rebase-subtree.sh
@@ -82,11 +82,12 @@  test_expect_failure 'Rebase -Xsubtree --keep-empty --preserve-merges --onto comm
 	verbose test "$(commit_message HEAD)" = "Empty commit"
 '
 
-# FAILURE: fatal: Could not parse object
-test_expect_failure 'Rebase -Xsubtree --keep-empty --onto commit' '
+test_expect_success 'Rebase -Xsubtree --keep-empty --onto commit' '
 	reset_rebase &&
 	git checkout -b rebase-onto to-rebase &&
-	git rebase -Xsubtree=files_subtree --keep-empty --onto files-master master &&
+	test_must_fail git rebase -Xsubtree=files_subtree --keep-empty --onto files-master master &&
+	: first pick results in no changes &&
+	git rebase --continue &&
 	verbose test "$(commit_message HEAD~2)" = "master4" &&
 	verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
 	verbose test "$(commit_message HEAD)" = "Empty commit"