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 <gitster@pobox.com>
Junio C Hamano committed
Jan 27, 2009 at 01:07 UTC
967476966513564e9c28847f7a974b8af5093493
1 file changed
+26
t/t3404-rebase-interactive.sh
+26
@@ -462,4 +462,30 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
462
463
'
464
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
+
491
test_done