BASE_PATH='/data/vcs/git'
+function init_repos() {
+ mkdir "$1" &> /dev/null || return 1
+ (cd $1 && git --bare init &> /dev/null) || return 1
+}
+
# We keep an array of arguments, so we can handle quoting an spaces in
# arguments properly.
ARGS=()
# When the client wants us to receive a pack, create the git
# repository if it does not exist yet
if [ "`basename $0`" = "git-receive-pack" -a ! -e "$DIR" ]; then
- mkdir "$DIR" &> /dev/null && (cd $DIR && git --bare init &> /dev/null)
+ init_repos "$DIR"
fi
ARGS[$i]="$DIR"
else