blob: b1682944e280e28fe48d7b1f96faa46fb7290b3a [file] [log] [blame]
Patrick Steinhardtcee137b2025-04-03 07:06:07 +02001#!/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.
9if test -f one-time-script
10then
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
24else
25 "$GIT_EXEC_PATH/git-http-backend"
26fi