summaryrefslogtreecommitdiff
path: root/src/repo
blob: 34d89f817b477be41217a973c1bacdcd746f4f0f (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
#!/bin/sh
set -eu

usage() {
	cat <<-'EOF'
		Usage: repo NAME
	EOF
}


NAME="${1:-}"
eval "$(assert-arg -- "$NAME" 'NAME')"


sudo sudo -u git \
	env GIT_CONFIG_GLOBAL=/etc/gitconfig \
		git init --bare /srv/git/"$NAME".git

cd /srv/git/"$NAME".git/hooks

sudo sudo -u git \
	rm -f *.sample

sudo sudo -u git \
	ln -fs "$(command -v cicd-post-receive)" post-receive