summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: faf7526)
raw | patch | inline | side by side (parent: faf7526)
author | Thomas Rast <trast@student.ethz.ch> | |
Sun, 28 Mar 2010 19:36:00 +0000 (21:36 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 29 Mar 2010 04:34:40 +0000 (21:34 -0700) |
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>
'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>
git-rebase--interactive.sh | patch | blob | history | |
t/t5407-post-rewrite-hook.sh | patch | blob | history |
index 415ae72dbc298d7723cdd23b1396c8a6d24dbe08..8a2771f1f9217750334c939edfcdb2b9d278ee96 100755 (executable)
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"
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
;;
index f0f91f149d760f6b6458d10639725259973d7115..552da65a61e8f78d40f8e19cfc5b73696ebcf283 100755 (executable)
verify_hook_input
'
+test_expect_success 'git rebase -i (double edit)' '
+ git reset --hard D &&
+ clear_hook_input &&
+ FAKE_LINES="edit 1 edit 2" git rebase -i B &&
+ git rebase --continue &&
+ echo something > foo &&
+ git add foo &&
+ git rebase --continue &&
+ echo rebase >expected.args &&
+ cat >expected.data <<EOF &&
+$(git rev-parse C) $(git rev-parse HEAD^)
+$(git rev-parse D) $(git rev-parse HEAD)
+EOF
+ verify_hook_input
+'
+
test_done