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 () {
373373 pick_one -n $sha1 || failed=t
374374 case " $( peek_next_command) " in
375375 squash|s)
376- EDIT_COMMIT=
377376 USE_OUTPUT=output
378377 MSG_OPT=-F
379- MSG_FILE =" $MSG "
378+ EDIT_OR_FILE =" $MSG "
380379 cp " $MSG " " $SQUASH_MSG "
381380 ;;
382381 * )
383- EDIT_COMMIT=-e
384382 USE_OUTPUT=
385383 MSG_OPT=
386- MSG_FILE=
384+ EDIT_OR_FILE=-e
387385 rm -f " $SQUASH_MSG " || exit
388386 cp " $MSG " " $GIT_DIR " /SQUASH_MSG
389387 rm -f " $GIT_DIR " /MERGE_MSG || exit
@@ -397,7 +395,8 @@ do_next () {
397395 GIT_AUTHOR_NAME=" $GIT_AUTHOR_NAME " \
398396 GIT_AUTHOR_EMAIL=" $GIT_AUTHOR_EMAIL " \
399397 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
401400 fi
402401 if test $failed = t
403402 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' '
433433
434434'
435435
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+
436462test_done
You can’t perform that action at this time.
0 commit comments