t/lib-httpd: use write_script to copy CGI scripts

Using write_script will set our shebang line appropriately with $SHELL_PATH. The script that is there now is quite simple and likely to succeed even with a non-POSIX /bin/sh, but it does not hurt to be defensive. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed May 22, 2014 at 05:28 UTC c7db2d16474874b21aad9141e6856f836f719643
2 files changed +5 -2
t/lib-httpd.sh
+5 -1
@@ -105,10 +105,14 @@ else
105 "Could not identify web server at '$LIB_HTTPD_PATH'"
106 fi
107
108 +install_script () {
109 + write_script "$HTTPD_ROOT_PATH/$1" <"$TEST_PATH/$1"
110 +}
111 +
112 prepare_httpd() {
113 mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
114 cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH"
111 - cp "$TEST_PATH"/broken-smart-http.sh "$HTTPD_ROOT_PATH"
115 + install_script broken-smart-http.sh
116
117 ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"
118
t/lib-httpd/broken-smart-http.sh
-1
@@ -1,4 +1,3 @@
1 -#!/bin/sh
1 printf "Content-Type: text/%s\n" "html"
2 echo
3 printf "%s\n" "001e# service=git-upload-pack"