X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=usr%2Flocal%2Fbin%2Fgit-wrapper;h=5a55eb7af92f42ca6c7d68ce0c1db5d6c2fe8056;hb=refs%2Fheads%2Flogin;hp=570a47d2d737a82fcfda6365bd311a205b9ad2b5;hpb=d25f70d83bd46b7e0b58f7a87d522f74fdf28431;p=matthijs%2Fservers%2Fdrsnuggles.git diff --git a/usr/local/bin/git-wrapper b/usr/local/bin/git-wrapper index 570a47d..5a55eb7 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 post-receive" 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 -f "$HOOKS_PATH/$hook" "$1/hooks/" || return 1 + done } # We keep an array of arguments, so we can handle quoting an spaces in