]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5403-post-checkout-hook.sh
clone: run post-checkout hook when checking out
[thirdparty/git.git] / t / t5403-post-checkout-hook.sh
index 9b2e1a94c5fb5aa094853a169cbdf2f7dc56e152..4fdb418550ee0f3c93e80f8c3df41094c0ada00c 100755 (executable)
@@ -71,4 +71,16 @@ test_expect_success 'post-checkout receives the right args when not switching br
         test $old = $new -a $flag = 0
 '
 
+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
+'
+
 test_done