summaryrefslogtreecommitdiffstats
path: root/git-http-backend.cgi
blob: c69758b713d002f5bc8943d6b5166b10df88b79c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
# A .cgi-named door onto the stock backend, because mod_cgi dispatches by
# extension.  No policy in here: writes are decided by the pre-receive hook.
#
# It must stay a plain exec.  REMOTE_USER is the identity the hooks authorise
# from, and rewriting the environment here denies every push.
set -eu

BACKEND="${GIT_HOST_HTTP_BACKEND:-/usr/libexec/git-core/git-http-backend}"
[ -x "$BACKEND" ] || { printf 'Status: 500 Internal Server Error\r\n\r\n' >&2; exit 1; }

exec "$BACKEND"