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 () {
284
284
pick_one $sha1 ||
285
285
die_with_patch $sha1 " Could not apply $sha1 ... $rest "
286
286
make_patch $sha1
287
- : > " $DOTEST " /amend
287
+ git rev-parse --verify HEAD > " $DOTEST " /amend
288
288
warn " Stopped at $sha1 ... $rest "
289
289
warn " You can amend the commit now, with"
290
290
warn
427
427
else
428
428
. " $DOTEST " /author-script ||
429
429
die " Cannot find the author identity"
430
+ amend=
430
431
if test -f " $DOTEST " /amend
431
432
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."
432
438
git reset --soft HEAD^ ||
433
439
die " Cannot rewind the HEAD"
434
440
fi
435
441
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
+ }
438
446
fi
439
447
440
448
require_clean_work_tree
You can’t perform that action at this time.
0 commit comments