Skip to content

Commit

Permalink
t/lib-httpd: use write_script to copy CGI scripts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed May 23, 2014
1 parent e2a0ccc commit c7db2d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion t/lib-httpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ else
"Could not identify web server at '$LIB_HTTPD_PATH'"
fi

install_script () {
write_script "$HTTPD_ROOT_PATH/$1" <"$TEST_PATH/$1"
}

prepare_httpd() {
mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH"
cp "$TEST_PATH"/broken-smart-http.sh "$HTTPD_ROOT_PATH"
install_script broken-smart-http.sh

ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"

Expand Down
1 change: 0 additions & 1 deletion t/lib-httpd/broken-smart-http.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
printf "Content-Type: text/%s\n" "html"
echo
printf "%s\n" "001e# service=git-upload-pack"
Expand Down

0 comments on commit c7db2d1

Please sign in to comment.