aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-18 19:53:25 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-18 19:53:25 -0700
commitea2408bfe18b4f9d1eaa9d8587c5ae6196552cac (patch)
treea1794cb4bef2c8267ee365df5f78c51d5a61ce63
parent2ba3d5d9bd47c42400049e81d0e1e94948112277 (diff)
parentc14c3c82da9a46c65008060ad8e6dacef1a24ba9 (diff)
downloadgit-ea2408bfe18b4f9d1eaa9d8587c5ae6196552cac.tar.gz
git-ea2408bfe18b4f9d1eaa9d8587c5ae6196552cac.tar.xz
Merge branch 'dp/maint-rebase-fix' into maint
* dp/maint-rebase-fix: git-rebase--interactive: auto amend only edited commit git-rebase-interactive: do not squash commits on abort
-rwxr-xr-xgit-rebase--interactive.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 929d681c4..edb6ec6ed 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -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
@@ -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