diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-11-23 22:28:31 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-11-23 22:28:31 -0800 |
commit | 2a971012b6be236c46cab7212239d70d92b02715 (patch) | |
tree | ca5f9efba4fed1236e686818629213bac12ce319 /t/gitweb-lib.sh | |
parent | 783cfafb91538c178d78a9f6c7b609e4f06582f8 (diff) | |
parent | f74a83fcf04c50e8358c8fb493539af13f9b9aa5 (diff) | |
download | git-2a971012b6be236c46cab7212239d70d92b02715.tar.gz git-2a971012b6be236c46cab7212239d70d92b02715.tar.xz |
Merge branch 'mr/gitweb-snapshot'
* mr/gitweb-snapshot:
t/gitweb-lib: Split HTTP response with non-GNU sed
gitweb: Smarter snapshot names
gitweb: Document current snapshot rules via new tests
t/gitweb-lib.sh: Split gitweb output into headers and body
gitweb: check given hash before trying to create snapshot
Diffstat (limited to 't/gitweb-lib.sh')
-rw-r--r-- | t/gitweb-lib.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh index 845253274..76d8b7b80 100644 --- a/t/gitweb-lib.sh +++ b/t/gitweb-lib.sh @@ -52,10 +52,24 @@ gitweb_run () { rm -f gitweb.log && perl -- "$SCRIPT_NAME" \ >gitweb.output 2>gitweb.log && + perl -w -e ' + open O, ">gitweb.headers"; + while (<>) { + print O; + last if (/^\r$/ || /^$/); + } + open O, ">gitweb.body"; + while (<>) { + print O; + } + close O; + ' gitweb.output && 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 |