aboutsummaryrefslogtreecommitdiff
path: root/t/gitweb-lib.sh
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2009-10-29 23:07:41 +0100
committerJunio C Hamano <gitster@pobox.com>2009-10-30 16:34:49 -0700
commit46e09f310567b680c03151e048bf2b7e847611e2 (patch)
tree43a70ed10f0c1a8c3fe299a6fd780f113440a445 /t/gitweb-lib.sh
parentfdb0c36e903d13c184f9a465035c75565c5c072a (diff)
downloadgit-46e09f310567b680c03151e048bf2b7e847611e2.tar.gz
git-46e09f310567b680c03151e048bf2b7e847611e2.tar.xz
t/gitweb-lib.sh: Split gitweb output into headers and body
Save HTTP headers into gitweb.headers, and the body of message into gitweb.body in gitweb_run() Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/gitweb-lib.sh')
-rw-r--r--t/gitweb-lib.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 845253274..32b841dd2 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -52,10 +52,14 @@ gitweb_run () {
rm -f gitweb.log &&
perl -- "$SCRIPT_NAME" \
>gitweb.output 2>gitweb.log &&
+ sed -e '/^\r$/q' <gitweb.output >gitweb.headers &&
+ sed -e '1,/^\r$/d' <gitweb.output >gitweb.body &&
if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi
# gitweb.log is left for debugging
- # gitweb.output is used to parse http output
+ # gitweb.output is used to parse HTTP output
+ # gitweb.headers contains only HTTP headers
+ # gitweb.body contains body of message, without headers
}
. ./test-lib.sh