Skip to content

Commit 4e6023b

Browse files
dschogitster
authored andcommitted
t3427: fix another incorrect assumption
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f67336d commit 4e6023b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

t/t3427-rebase-subtree.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --
8282
verbose test "$(commit_message HEAD)" = "Empty commit"
8383
'
8484

85-
# FAILURE: fatal: Could not parse object
86-
test_expect_failure 'Rebase -Xsubtree --keep-empty --onto commit' '
85+
test_expect_success 'Rebase -Xsubtree --keep-empty --onto commit' '
8786
reset_rebase &&
8887
git checkout -b rebase-onto to-rebase &&
89-
git rebase -Xsubtree=files_subtree --keep-empty --onto files-master master &&
88+
test_must_fail git rebase -Xsubtree=files_subtree --keep-empty --onto files-master master &&
89+
: first pick results in no changes &&
90+
git rebase --continue &&
9091
verbose test "$(commit_message HEAD~2)" = "master4" &&
9192
verbose test "$(commit_message HEAD~)" = "files_subtree/master5" &&
9293
verbose test "$(commit_message HEAD)" = "Empty commit"

0 commit comments

Comments
 (0)