X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5403-post-checkout-hook.sh;h=5858b868ed6ff05d458996cf8c359a7148591582;hb=c511549e0c6848f00bd19f152b8ab42261ff5d0c;hp=9b2e1a94c5fb5aa094853a169cbdf2f7dc56e152;hpb=f39adc250c3e554c437d027bbc06309a78fd026d;p=git.git diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh index 9b2e1a94c..5858b868e 100755 --- a/t/t5403-post-checkout-hook.sh +++ b/t/t5403-post-checkout-hook.sh @@ -71,4 +71,18 @@ test_expect_success 'post-checkout receives the right args when not switching br test $old = $new -a $flag = 0 ' +if test "$(git config --bool core.filemode)" = true; then +mkdir -p templates/hooks +cat >templates/hooks/post-checkout <<'EOF' +#!/bin/sh +echo $@ > $GIT_DIR/post-checkout.args +EOF +chmod +x templates/hooks/post-checkout + +test_expect_success 'post-checkout hook is triggered by clone' ' + git clone --template=templates . clone3 && + test -f clone3/.git/post-checkout.args +' +fi + test_done