Skip to content

Commit

Permalink
Merge branch 'dp/maint-rebase-fix' into maint
Browse files Browse the repository at this point in the history
* dp/maint-rebase-fix:
  git-rebase--interactive: auto amend only edited commit
  git-rebase-interactive: do not squash commits on abort
  • Loading branch information
gitster committed Sep 19, 2008
2 parents 2ba3d5d + c14c3c8 commit ea2408b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ do_next () {
pick_one $sha1 ||
die_with_patch $sha1 "Could not apply $sha1... $rest"
make_patch $sha1
: > "$DOTEST"/amend
git rev-parse --verify HEAD > "$DOTEST"/amend
warn "Stopped at $sha1... $rest"
warn "You can amend the commit now, with"
warn
Expand Down Expand Up @@ -427,14 +427,22 @@ do
else
. "$DOTEST"/author-script ||
die "Cannot find the author identity"
amend=
if test -f "$DOTEST"/amend
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^ ||
die "Cannot rewind the HEAD"
fi
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&
git commit --no-verify -F "$DOTEST"/message -e ||
die "Could not commit staged changes."
git commit --no-verify -F "$DOTEST"/message -e || {
test -n "$amend" && git reset --soft $amend
die "Could not commit staged changes."
}
fi

require_clean_work_tree
Expand Down

0 comments on commit ea2408b

Please sign in to comment.