exit 1
fi
+unset yes
+if [ "$1" = "-y" ]; then
+ yes=y
+ shift
+fi
+
if [ $# -ne 1 ]; then
echo "usage: $0 <repopath>" >&2
exit 1
exit 1
fi
+# Do not create subdirectories without asking first
+repopath=$(dirname $1)
+if [ ! -d "$git_root/$repopath" ]; then
+ if [ ! $yes ]; then
+ echo -n "Create git subdir '$repopath' (y/N)? "
+ read ans
+ ans=$(expr "$ans" : '\(.\).*') # works with dash too
+ if [ "$ans" != "y" -a "$ans" != "Y" ];then
+ echo "repository creation aborted at user request"
+ exit 0
+ fi
+ fi
+ mkdir -p "$git_root/$repopath" 2>/dev/null
+ if [ ! -d "$git_root/$repopath" ]; then
+ echo "%0: repository not created, git subdir '$repopath' create failed" >&2
+ exit 1
+ fi
+fi
+
# Create the respository
umask 027
git --git-dir "$git_root/$1" init --bare