File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ do_next () {
284284 pick_one $sha1 ||
285285 die_with_patch $sha1 " Could not apply $sha1 ... $rest "
286286 make_patch $sha1
287- : > " $DOTEST " /amend
287+ git rev-parse --verify HEAD > " $DOTEST " /amend
288288 warn " Stopped at $sha1 ... $rest "
289289 warn " You can amend the commit now, with"
290290 warn
427427 else
428428 . " $DOTEST " /author-script ||
429429 die " Cannot find the author identity"
430+ amend=
430431 if test -f " $DOTEST " /amend
431432 then
433+ amend=$( git rev-parse --verify HEAD)
434+ test " $amend " = $( cat " $DOTEST " /amend) ||
435+ die " \
436+ You have uncommitted changes in your working tree. Please, commit them
437+ first and then run 'git rebase --continue' again."
432438 git reset --soft HEAD^ ||
433439 die " Cannot rewind the HEAD"
434440 fi
435441 export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&
436- git commit --no-verify -F " $DOTEST " /message -e ||
437- die " Could not commit staged changes."
442+ git commit --no-verify -F " $DOTEST " /message -e || {
443+ test -n " $amend " && git reset --soft $amend
444+ die " Could not commit staged changes."
445+ }
438446 fi
439447
440448 require_clean_work_tree
You can’t perform that action at this time.
0 commit comments