Patrick Steinhardt | cee137b | 2025-04-03 07:06:07 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # If "one-time-script" exists in $HTTPD_ROOT_PATH, run the script on the HTTP |
| 4 | # response. If the response was modified as a result, delete "one-time-script" |
| 5 | # so that subsequent HTTP responses are no longer modified. |
| 6 | # |
| 7 | # This can be used to simulate the effects of the repository changing in |
| 8 | # between HTTP request-response pairs. |
| 9 | if test -f one-time-script |
| 10 | then |
| 11 | LC_ALL=C |
| 12 | export LC_ALL |
| 13 | |
| 14 | "$GIT_EXEC_PATH/git-http-backend" >out |
| 15 | ./one-time-script out >out_modified |
| 16 | |
| 17 | if cmp -s out out_modified |
| 18 | then |
| 19 | cat out |
| 20 | else |
| 21 | cat out_modified |
| 22 | rm one-time-script |
| 23 | fi |
| 24 | else |
| 25 | "$GIT_EXEC_PATH/git-http-backend" |
| 26 | fi |