t5550: use write_script to generate post-update hook
authorBrandon Williams <bmwill@google.com>
Tue, 18 Apr 2017 23:17:55 +0000 (16:17 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Apr 2017 04:27:08 +0000 (21:27 -0700)
The post-update hooks created in t5550-http-fetch-dumb.sh is missing the
"!#/bin/sh" line which can cause issues with portability. Instead
create the hook using the 'write_script' function which includes the
proper "#!" line.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5550-http-fetch-dumb.sh
index 87308cdced9af11365d5eb0644b9ac86fac21177..8552184e741fe2465e746a3ac42d19edddb15576 100755 (executable)
@@ -20,8 +20,9 @@ test_expect_success 'create http-accessible bare repository with loose objects'
        (cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
         git config core.bare true &&
         mkdir -p hooks &&
-        echo "exec git update-server-info" >hooks/post-update &&
-        chmod +x hooks/post-update &&
+        write_script "hooks/post-update" <<-\EOF &&
+        exec git update-server-info
+       EOF
         hooks/post-update
        ) &&
        git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&