This makes it possible to have a single hook script that calls multiple
different ones, instead of being just a symlink to a single script.
# --base-path-relaxed.
BASE_PATH='/data/vcs/git'
-POST_UPDATE_HOOK="$BASE_PATH/hooks/post-update"
+HOOKS_PATH="$BASE_PATH/hooks"
+HOOKS=post-update
function init_repos() {
mkdir "$1" &> /dev/null || return 1
(cd $1 && git --bare init &> /dev/null) || return 1
- cp -P "$POST_UPDATE_HOOK" "$1/hooks/" || return 1
+ for hook in $HOOKS; do
+ ln -s "$HOOKS_PATH/$hook" "$1/hooks/" || return 1
+ done
}
# We keep an array of arguments, so we can handle quoting an spaces in