mirror of
https://github.com/git/git.git
synced 2024-11-08 10:13:18 +01:00
Merge branch 'dp/maint-rebase-fix'
* dp/maint-rebase-fix: git-rebase--interactive: auto amend only edited commit git-rebase-interactive: do not squash commits on abort
This commit is contained in:
commit
132c6e443c
1 changed files with 11 additions and 3 deletions
|
@ -284,7 +284,7 @@ do_next () {
|
||||||
pick_one $sha1 ||
|
pick_one $sha1 ||
|
||||||
die_with_patch $sha1 "Could not apply $sha1... $rest"
|
die_with_patch $sha1 "Could not apply $sha1... $rest"
|
||||||
make_patch $sha1
|
make_patch $sha1
|
||||||
: > "$DOTEST"/amend
|
git rev-parse --verify HEAD > "$DOTEST"/amend
|
||||||
warn "Stopped at $sha1... $rest"
|
warn "Stopped at $sha1... $rest"
|
||||||
warn "You can amend the commit now, with"
|
warn "You can amend the commit now, with"
|
||||||
warn
|
warn
|
||||||
|
@ -427,14 +427,22 @@ do
|
||||||
else
|
else
|
||||||
. "$DOTEST"/author-script ||
|
. "$DOTEST"/author-script ||
|
||||||
die "Cannot find the author identity"
|
die "Cannot find the author identity"
|
||||||
|
amend=
|
||||||
if test -f "$DOTEST"/amend
|
if test -f "$DOTEST"/amend
|
||||||
then
|
then
|
||||||
|
amend=$(git rev-parse --verify HEAD)
|
||||||
|
test "$amend" = $(cat "$DOTEST"/amend) ||
|
||||||
|
die "\
|
||||||
|
You have uncommitted changes in your working tree. Please, commit them
|
||||||
|
first and then run 'git rebase --continue' again."
|
||||||
git reset --soft HEAD^ ||
|
git reset --soft HEAD^ ||
|
||||||
die "Cannot rewind the HEAD"
|
die "Cannot rewind the HEAD"
|
||||||
fi
|
fi
|
||||||
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&
|
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&
|
||||||
git commit --no-verify -F "$DOTEST"/message -e ||
|
git commit --no-verify -F "$DOTEST"/message -e || {
|
||||||
die "Could not commit staged changes."
|
test -n "$amend" && git reset --soft $amend
|
||||||
|
die "Could not commit staged changes."
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
require_clean_work_tree
|
require_clean_work_tree
|
||||||
|
|
Loading…
Reference in a new issue