Code

Merge branch 'maint-1.6.2' into maint-1.6.3
[git.git] / t / t5403-post-checkout-hook.sh
index a7bef9371fc190d799e1e3741605fe8b626029c3..d05a9138b46eec072750142f912a41caa3e23d83 100755 (executable)
@@ -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