File tree Expand file tree Collapse file tree 2 files changed +30
-5
lines changed Expand file tree Collapse file tree 2 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -360,17 +360,15 @@ do_next () {
360
360
pick_one -n $sha1 || failed=t
361
361
case " $( peek_next_command) " in
362
362
squash|s)
363
- EDIT_COMMIT=
364
363
USE_OUTPUT=output
365
364
MSG_OPT=-F
366
- MSG_FILE =" $MSG "
365
+ EDIT_OR_FILE =" $MSG "
367
366
cp " $MSG " " $SQUASH_MSG "
368
367
;;
369
368
* )
370
- EDIT_COMMIT=-e
371
369
USE_OUTPUT=
372
370
MSG_OPT=
373
- MSG_FILE=
371
+ EDIT_OR_FILE=-e
374
372
rm -f " $SQUASH_MSG " || exit
375
373
cp " $MSG " " $GIT_DIR " /SQUASH_MSG
376
374
rm -f " $GIT_DIR " /MERGE_MSG || exit
@@ -384,7 +382,8 @@ do_next () {
384
382
GIT_AUTHOR_NAME=" $GIT_AUTHOR_NAME " \
385
383
GIT_AUTHOR_EMAIL=" $GIT_AUTHOR_EMAIL " \
386
384
GIT_AUTHOR_DATE=" $GIT_AUTHOR_DATE " \
387
- $USE_OUTPUT git commit --no-verify $MSG_OPT " $MSG_FILE " $EDIT_COMMIT || failed=t
385
+ $USE_OUTPUT git commit --no-verify \
386
+ $MSG_OPT " $EDIT_OR_FILE " || failed=t
388
387
fi
389
388
if test $failed = t
390
389
then
Original file line number Diff line number Diff line change @@ -462,4 +462,30 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
462
462
463
463
'
464
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_success ' submodule rebase -i' '
488
+ FAKE_LINES="1 squash 2 3" git rebase -i A
489
+ '
490
+
465
491
test_done
You can’t perform that action at this time.
0 commit comments