[PATCH] Test t5560: Fix test when run with dash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dash is more finicky than some shells and this change seems to make it
happier.

Reported-by: Michael Haggerty <mhagger@xxxxxxxxxxxx>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@xxxxxxxxx>

---
Michael, thanks for the report.

Ubuntu's /bin/sh is dash, which I had not tested with.  Installing
dash on my machine, I was able to reproduce and this patch fixes the
problem for me.

Could you please see if this works for you?

Thanks,
Tarmigan
---
 t/t5560-http-backend-noserver.sh |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh
index 5f8c88e..f2e413d 100755
--- a/t/t5560-http-backend-noserver.sh
+++ b/t/t5560-http-backend-noserver.sh
@@ -10,12 +10,13 @@ run_backend() {
 	QUERY_STRING="${1#*\?}" \
 	GIT_PROJECT_ROOT="$HTTPD_DOCUMENT_ROOT_PATH" \
 	PATH_INFO="${1%%\?*}" \
+	REQUEST_METHOD="$3" \
+	CONTENT_TYPE="$4" \
 	git http-backend >act.out 2>act.err
 }
 
 GET() {
-	REQUEST_METHOD="GET" \
-	run_backend "/repo.git/$1" &&
+	run_backend "/repo.git/$1" "" "GET" &&
 	if ! grep "Status" act.out >act
 	then
 		printf "Status: 200 OK\r\n" >act
@@ -25,9 +26,7 @@ GET() {
 }
 
 POST() {
-	REQUEST_METHOD="POST" \
-	CONTENT_TYPE="application/x-$1-request" \
-	run_backend "/repo.git/$1" "$2" &&
+	run_backend "/repo.git/$1" "$2" "POST" "application/x-$1-request" &&
 	if ! grep "Status" act.out >act
 	then
 		printf "Status: 200 OK\r\n" >act
-- 
1.6.6.376.gabe8e

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]