diff options
author | Orgad Shaneh <orgads@gmail.com> | 2018-12-30 00:37:59 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-03 00:18:33 +0300 |
commit | 8581df65ec961aa59004f2d6342709b25d7b79c4 (patch) | |
tree | 38ec95a5ed0b6af2ce78bff3f58e513a23dda1c6 /t/t5403-post-checkout-hook.sh | |
parent | 10499a9d586b3fba4ea6f67cd0b391b9e7048f34 (diff) |
rebase: run post-checkout hook on checkout
The scripted version of rebase used to run this hook on the initial
checkout. The transition to built-in introduced a regression.
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5403-post-checkout-hook.sh')
-rwxr-xr-x | t/t5403-post-checkout-hook.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh index 1d15a1031f..a539ffc080 100755 --- a/t/t5403-post-checkout-hook.sh +++ b/t/t5403-post-checkout-hook.sh @@ -13,6 +13,8 @@ test_expect_success setup ' EOF test_commit one && test_commit two && + test_commit rebase-on-me && + git reset --hard HEAD^ && test_commit three ' @@ -44,6 +46,24 @@ test_expect_success 'post-checkout receives the right args when not switching br test $old = $new && test $flag = 0 ' +test_expect_success 'post-checkout is triggered on rebase' ' + test_when_finished "rm -f .git/post-checkout.args" && + git checkout -b rebase-test master && + rm -f .git/post-checkout.args && + git rebase rebase-on-me && + read old new flag <.git/post-checkout.args && + test $old != $new && test $flag = 1 +' + +test_expect_success 'post-checkout is triggered on rebase with fast-forward' ' + test_when_finished "rm -f .git/post-checkout.args" && + git checkout -b ff-rebase-test rebase-on-me^ && + rm -f .git/post-checkout.args && + git rebase rebase-on-me && + read old new flag <.git/post-checkout.args && + test $old != $new && test $flag = 1 +' + test_expect_success 'post-checkout hook is triggered by clone' ' mkdir -p templates/hooks && write_script templates/hooks/post-checkout <<-\EOF && |