transport-helper: drop read/write errno checks
[git.git] / t / lib-httpd / apply-one-time-sed.sh
blobfcef72892547c70af0b33bdf96f0c5acb793ea9b
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 [ -e one-time-sed ]; then
11 "$GIT_EXEC_PATH/git-http-backend" >out
12 sed "$(cat one-time-sed)" <out >out_modified
14 if diff out out_modified >/dev/null; then
15 cat out
16 else
17 cat out_modified
18 rm one-time-sed
20 else
21 "$GIT_EXEC_PATH/git-http-backend"