summaryrefslogtreecommitdiff
path: root/t/t5407-post-rewrite-hook.sh
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2015-05-22 13:15:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-22 15:39:02 (GMT)
commitb12d3e904dc6deba7885d8528538de13e28128dd (patch)
tree6e56432f71e5279b60018de640edb0cebd8fb348 /t/t5407-post-rewrite-hook.sh
parent1d968ca69809ffb7b9105a4785aa0bc3b37b1434 (diff)
downloadgit-b12d3e904dc6deba7885d8528538de13e28128dd.zip
git-b12d3e904dc6deba7885d8528538de13e28128dd.tar.gz
git-b12d3e904dc6deba7885d8528538de13e28128dd.tar.bz2
rebase -i: fix post-rewrite hook with failed exec command
Usually, when 'git rebase' stops before completing the rebase, it is to give the user an opportunity to edit a commit (e.g. with the 'edit' command). In such cases, 'git rebase' leaves the sha1 of the commit being rewritten in "$state_dir"/stopped-sha, and subsequent 'git rebase --continue' will call the post-rewrite hook with this sha1 as <old-sha1> argument to the post-rewrite hook. The case of 'git rebase' stopping because of a failed 'exec' command is different: it gives the opportunity to the user to examine or fix the failure, but does not stop saying "here's a commit to edit, use --continue when you're done". So, there's no reason to call the post-rewrite hook for 'exec' commands. If the user did rewrite the commit, it would be with 'git commit --amend' which already called the post-rewrite hook. Fix the behavior to leave no stopped-sha file in case of failed exec command, and teach 'git rebase --continue' to skip record_in_rewritten if no stopped-sha file is found. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5407-post-rewrite-hook.sh')
-rwxr-xr-xt/t5407-post-rewrite-hook.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t5407-post-rewrite-hook.sh b/t/t5407-post-rewrite-hook.sh
index 53a4062..06ffad6 100755
--- a/t/t5407-post-rewrite-hook.sh
+++ b/t/t5407-post-rewrite-hook.sh
@@ -212,7 +212,7 @@ EOF
verify_hook_input
'
-test_expect_failure 'git rebase -i (exec)' '
+test_expect_success 'git rebase -i (exec)' '
git reset --hard D &&
clear_hook_input &&
FAKE_LINES="edit 1 exec_false 2" git rebase -i B &&