Skip to content

Commit

Permalink
rebase -i squashes submodule changes into unrelated commit
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jan 28, 2009
1 parent 02322e1 commit 9674769
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions t/t3404-rebase-interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,30 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
'

test_expect_success 'submodule rebase setup' '
git checkout A &&
mkdir sub &&
(
cd sub && git init && >elif &&
git add elif && git commit -m "submodule initial"
) &&
echo 1 >file1 &&
git add file1 sub
test_tick &&
git commit -m "One" &&
echo 2 >file1 &&
test_tick &&
git commit -a -m "Two" &&
(
cd sub && echo 3 >elif &&
git commit -a -m "submodule second"
) &&
test_tick &&
git commit -a -m "Three changes submodule"
'

test_expect_failure 'submodule rebase -i' '
FAKE_LINES="1 squash 2 3" git rebase -i A
'

test_done

0 comments on commit 9674769

Please sign in to comment.