Skip to content

Commit 46e09f3

Browse files
jnarebgitster
authored andcommitted
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>
1 parent fdb0c36 commit 46e09f3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/gitweb-lib.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ gitweb_run () {
5252
rm -f gitweb.log &&
5353
perl -- "$SCRIPT_NAME" \
5454
>gitweb.output 2>gitweb.log &&
55+
sed -e '/^\r$/q' <gitweb.output >gitweb.headers &&
56+
sed -e '1,/^\r$/d' <gitweb.output >gitweb.body &&
5557
if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi
5658

5759
# gitweb.log is left for debugging
58-
# gitweb.output is used to parse http output
60+
# gitweb.output is used to parse HTTP output
61+
# gitweb.headers contains only HTTP headers
62+
# gitweb.body contains body of message, without headers
5963
}
6064

6165
. ./test-lib.sh

0 commit comments

Comments
 (0)