Skip to content

Commit c7db2d1

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e2a0ccc commit c7db2d1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

t/lib-httpd.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,14 @@ else
105105
"Could not identify web server at '$LIB_HTTPD_PATH'"
106106
fi
107107

108+
install_script () {
109+
write_script "$HTTPD_ROOT_PATH/$1" <"$TEST_PATH/$1"
110+
}
111+
108112
prepare_httpd() {
109113
mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
110114
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
112116

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

t/lib-httpd/broken-smart-http.sh

100755100644
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/bin/sh
21
printf "Content-Type: text/%s\n" "html"
32
echo
43
printf "%s\n" "001e# service=git-upload-pack"

0 commit comments

Comments
 (0)