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 @@ -373,17 +373,15 @@ do_next () {
373
373
pick_one -n $sha1 || failed=t
374
374
case " $( peek_next_command) " in
375
375
squash|s)
376
- EDIT_COMMIT=
377
376
USE_OUTPUT=output
378
377
MSG_OPT=-F
379
- MSG_FILE =" $MSG "
378
+ EDIT_OR_FILE =" $MSG "
380
379
cp " $MSG " " $SQUASH_MSG "
381
380
;;
382
381
* )
383
- EDIT_COMMIT=-e
384
382
USE_OUTPUT=
385
383
MSG_OPT=
386
- MSG_FILE=
384
+ EDIT_OR_FILE=-e
387
385
rm -f " $SQUASH_MSG " || exit
388
386
cp " $MSG " " $GIT_DIR " /SQUASH_MSG
389
387
rm -f " $GIT_DIR " /MERGE_MSG || exit
@@ -397,7 +395,8 @@ do_next () {
397
395
GIT_AUTHOR_NAME=" $GIT_AUTHOR_NAME " \
398
396
GIT_AUTHOR_EMAIL=" $GIT_AUTHOR_EMAIL " \
399
397
GIT_AUTHOR_DATE=" $GIT_AUTHOR_DATE " \
400
- $USE_OUTPUT git commit --no-verify $MSG_OPT " $MSG_FILE " $EDIT_COMMIT || failed=t
398
+ $USE_OUTPUT git commit --no-verify \
399
+ $MSG_OPT " $EDIT_OR_FILE " || failed=t
401
400
fi
402
401
if test $failed = t
403
402
then
Original file line number Diff line number Diff line change @@ -433,4 +433,30 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
433
433
434
434
'
435
435
436
+ test_expect_success ' submodule rebase setup' '
437
+ git checkout A &&
438
+ mkdir sub &&
439
+ (
440
+ cd sub && git init && >elif &&
441
+ git add elif && git commit -m "submodule initial"
442
+ ) &&
443
+ echo 1 >file1 &&
444
+ git add file1 sub
445
+ test_tick &&
446
+ git commit -m "One" &&
447
+ echo 2 >file1 &&
448
+ test_tick &&
449
+ git commit -a -m "Two" &&
450
+ (
451
+ cd sub && echo 3 >elif &&
452
+ git commit -a -m "submodule second"
453
+ ) &&
454
+ test_tick &&
455
+ git commit -a -m "Three changes submodule"
456
+ '
457
+
458
+ test_expect_success ' submodule rebase -i' '
459
+ FAKE_LINES="1 squash 2 3" git rebase -i A
460
+ '
461
+
436
462
test_done
You can’t perform that action at this time.
0 commit comments