diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2022-01-26 13:05:40 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-26 12:08:53 -0800 |
commit | 4840002a5f44a4c256c55f70c59d3b0506d14e21 (patch) | |
tree | 4dc007512d0fe02557d1dfccc94bcb0ea63a9163 /t | |
parent | rebase: do not remove untracked files on checkout (diff) | |
download | tgif-4840002a5f44a4c256c55f70c59d3b0506d14e21.tar.xz |
rebase --apply: don't run post-checkout hook if there is an error
The hook should only be run if the worktree and refs were successfully
updated. This primarily affects "rebase --apply" but also "rebase
--merge" when it fast-forwards.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5403-post-checkout-hook.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh index fd2817b406..d118181690 100755 --- a/t/t5403-post-checkout-hook.sh +++ b/t/t5403-post-checkout-hook.sh @@ -88,12 +88,16 @@ test_rebase () { test_expect_success "rebase $args checkout does not remove untracked files" ' test_when_finished "test_might_fail git rebase --abort" && + test_when_finished "rm -f .git/post-checkout.args" && git update-ref refs/heads/rebase-fast-forward three && git checkout two && + rm -f .git/post-checkout.args && echo untracked >three.t && test_when_finished "rm three.t" && test_must_fail git rebase $args HEAD rebase-fast-forward 2>err && - grep "untracked working tree files would be overwritten by checkout" err + grep "untracked working tree files would be overwritten by checkout" err && + test_path_is_missing .git/post-checkout.args + ' } |