summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2010-03-28 19:36:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-29 04:34:40 (GMT)
commit0acb62f202617cc58b6b4039dc9c7ad955ef0c88 (patch)
tree001e9c710a3c7a4d340f45024665b962b8696814 /git-rebase--interactive.sh
parentfaf752693abd0a891a9a47a2d398353cc59ee93a (diff)
downloadgit-0acb62f202617cc58b6b4039dc9c7ad955ef0c88.zip
git-0acb62f202617cc58b6b4039dc9c7ad955ef0c88.tar.gz
git-0acb62f202617cc58b6b4039dc9c7ad955ef0c88.tar.bz2
rebase -i: make post-rewrite work for 'edit'
The post-rewrite support, in the form of the call to 'record_in_rewritten', was hidden in the arm where we have to record a new commit for the user. This meant that it was never invoked in the case where the user has already amended the commit by herself. [The test is designed to exercise both arms of the 'if' in question.] Furthermore, recording the stopped-sha (the SHA1 of the commit before the editing) suffered from a cut&paste error from die_with_patch and used the wrong variable, hence it never recorded anything. Noticed by Junio. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-xgit-rebase--interactive.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 415ae72..8a2771f 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -484,7 +484,7 @@ do_next () {
mark_action_done
pick_one $sha1 ||
die_with_patch $sha1 "Could not apply $sha1... $rest"
- echo "$1" > "$DOTEST"/stopped-sha
+ echo "$sha1" > "$DOTEST"/stopped-sha
make_patch $sha1
git rev-parse --verify HEAD > "$AMEND"
warn "Stopped at $sha1... $rest"
@@ -732,9 +732,10 @@ first and then run 'git rebase --continue' again."
test -n "$amend" && git reset --soft $amend
die "Could not commit staged changes."
}
- record_in_rewritten "$(cat "$DOTEST"/stopped-sha)"
fi
+ record_in_rewritten "$(cat "$DOTEST"/stopped-sha)"
+
require_clean_work_tree
do_rest
;;