X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=usr%2Flocal%2Fbin%2Fgit-wrapper;fp=usr%2Flocal%2Fbin%2Fgit-wrapper;h=5481ffbf42f89e29303a64954e3429b0e1efab0f;hb=5e3f9a6568baf708c5bd88144cd9a59260301683;hp=570a47d2d737a82fcfda6365bd311a205b9ad2b5;hpb=48f94cd0e9814a2cb5f2c2dcb52dd4f5bcb7f81f;p=matthijs%2Fservers%2Fdrsnuggles.git diff --git a/usr/local/bin/git-wrapper b/usr/local/bin/git-wrapper index 570a47d..5481ffb 100755 --- a/usr/local/bin/git-wrapper +++ b/usr/local/bin/git-wrapper @@ -9,12 +9,15 @@ # --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