Skip to content

Commit 9674769

Browse files
committed
rebase -i squashes submodule changes into unrelated commit
Attempting to rebase three-commit series (two regular changes, followed by one commit that changes what commit is bound for a submodule path) to squash the first two results in a failure; not just the first two commits squashed, but the change to the submodule is also included in the result. This failure causes the subsequent step to "pick" the change that actually changes the submodule to be applied, because there is no change left to be applied. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 02322e1 commit 9674769

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,4 +462,30 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
462462
463463
'
464464

465+
test_expect_success 'submodule rebase setup' '
466+
git checkout A &&
467+
mkdir sub &&
468+
(
469+
cd sub && git init && >elif &&
470+
git add elif && git commit -m "submodule initial"
471+
) &&
472+
echo 1 >file1 &&
473+
git add file1 sub
474+
test_tick &&
475+
git commit -m "One" &&
476+
echo 2 >file1 &&
477+
test_tick &&
478+
git commit -a -m "Two" &&
479+
(
480+
cd sub && echo 3 >elif &&
481+
git commit -a -m "submodule second"
482+
) &&
483+
test_tick &&
484+
git commit -a -m "Three changes submodule"
485+
'
486+
487+
test_expect_failure 'submodule rebase -i' '
488+
FAKE_LINES="1 squash 2 3" git rebase -i A
489+
'
490+
465491
test_done

0 commit comments

Comments
 (0)