]> git.ipfire.org Git - thirdparty/git.git/blame - t/lib-httpd/apply-one-time-perl.sh
Merge branch 'tz/lib-gpg-prereq-fix'
[thirdparty/git.git] / t / lib-httpd / apply-one-time-perl.sh
CommitLineData
eafff6e4
JS
1#!/bin/sh
2
3# If "one-time-perl" exists in $HTTPD_ROOT_PATH, run perl on the HTTP response,
4# using the contents of "one-time-perl" as the perl command to be run. If the
5# response was modified as a result, delete "one-time-perl" so that subsequent
6# HTTP responses are no longer modified.
7#
8# This can be used to simulate the effects of the repository changing in
9# between HTTP request-response pairs.
10if test -f one-time-perl
11then
12 LC_ALL=C
13 export LC_ALL
14
15 "$GIT_EXEC_PATH/git-http-backend" >out
c1917156 16 "$PERL_PATH" -pe "$(cat one-time-perl)" out >out_modified
eafff6e4
JS
17
18 if cmp -s out out_modified
19 then
20 cat out
21 else
22 cat out_modified
23 rm one-time-perl
24 fi
25else
26 "$GIT_EXEC_PATH/git-http-backend"
27fi