Merge branch 'en/fill-directory-fixes'
[git/raj.git] / t / lib-httpd / apply-one-time-sed.sh
blobbf7689d0202f9fcef7798c0c122e217e98f12606
1 #!/bin/sh
3 # If "one-time-sed" exists in $HTTPD_ROOT_PATH, run sed on the HTTP response,
4 # using the contents of "one-time-sed" as the sed command to be run. If the
5 # response was modified as a result, delete "one-time-sed" so that subsequent
6 # HTTP responses are no longer modified.
8 # This can be used to simulate the effects of the repository changing in
9 # between HTTP request-response pairs.
10 if test -f one-time-sed
11 then
12 "$GIT_EXEC_PATH/git-http-backend" >out
13 sed "$(cat one-time-sed)" out >out_modified
15 if cmp -s out out_modified
16 then
17 cat out
18 else
19 cat out_modified
20 rm one-time-sed
22 else
23 "$GIT_EXEC_PATH/git-http-backend"