File: apply-one-time-perl.sh

package info (click to toggle)
git 1%3A2.39.5-0%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 56,868 kB
  • sloc: ansic: 276,518; sh: 234,536; perl: 30,909; tcl: 22,191; makefile: 4,185; python: 3,412; javascript: 772; csh: 45; ruby: 43; lisp: 12
file content (27 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

# If "one-time-perl" exists in $HTTPD_ROOT_PATH, run perl on the HTTP response,
# using the contents of "one-time-perl" as the perl command to be run. If the
# response was modified as a result, delete "one-time-perl" so that subsequent
# HTTP responses are no longer modified.
#
# This can be used to simulate the effects of the repository changing in
# between HTTP request-response pairs.
if test -f one-time-perl
then
	LC_ALL=C
	export LC_ALL

	"$GIT_EXEC_PATH/git-http-backend" >out
	perl -pe "$(cat one-time-perl)" out >out_modified

	if cmp -s out out_modified
	then
		cat out
	else
		cat out_modified
		rm one-time-perl
	fi
else
	"$GIT_EXEC_PATH/git-http-backend"
fi