summaryrefslogtreecommitdiff
path: root/post-update
blob: aaa206572cba1d8c70157422dc1540a57a23013c (about) (plain) (blame)
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

# this should maybe examine core.sharedRepository first
umask 0002

default_branch="$(git rev-parse --abbrev-ref HEAD)"
default_branch_path="$(git rev-parse --symbolic-full-name HEAD)"

if [ -n "$GIT_DIR" ]; then
	cd "$GIT_DIR"
elif [ -d .git ]; then
	cd .git
fi

mkdir -p info/web

if git show "$default_branch":README.md >/dev/null 2>&1; then
	git show "$default_branch":README.md | tee info/web/README.md | python -m markdown >info/web/README.html
else
	if git show "$default_branch":README.html >/dev/null 2>&1; then
		git show "$default_branch":README.html >info/web/README.html
	else
		rm -f info/web/README.html
	fi
fi
TZ= date +'%Y-%m-%d %H:%M:%S %z' >last-modified
exec git update-server-info