Skip to content

Commit

Permalink
t/gitweb-lib.sh: Split gitweb output into headers and body
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Oct 30, 2009
1 parent fdb0c36 commit 46e09f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion t/gitweb-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46e09f3

Please sign in to comment.