diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-12-31 17:46:40 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-12-31 17:46:40 +0200 |
commit | 30d6370719263da531d2405fb561d34e1340f49e (patch) | |
tree | c7c6749f13239367ba8e2afefc6aed6dabf0c499 /lib/support | |
parent | 83924495993753e6c503ce539c6533b54af6f86a (diff) | |
download | gitlab-ce-30d6370719263da531d2405fb561d34e1340f49e.tar.gz |
Add subdir support for rewrite-hooks script
Diffstat (limited to 'lib/support')
-rwxr-xr-x | lib/support/rewrite-hooks.sh | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/support/rewrite-hooks.sh b/lib/support/rewrite-hooks.sh index 6688785a179..b8fd36b9a1e 100755 --- a/lib/support/rewrite-hooks.sh +++ b/lib/support/rewrite-hooks.sh @@ -11,9 +11,22 @@ do continue fi - project_hook="$src/$dir/hooks/post-receive" - gitolite_hook="/home/git/.gitolite/hooks/common/post-receive" + if [[ "$dir" =~ ^.*.git$ ]] + then + project_hook="$src/$dir/hooks/post-receive" + gitolite_hook="/home/git/.gitolite/hooks/common/post-receive" + + ln -s -f $gitolite_hook $project_hook + else + for subdir in `ls "$src/$dir/"` + do + if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*.git$ ]]; then + project_hook="$src/$dir/$subdir/hooks/post-receive" + gitolite_hook="/home/git/.gitolite/hooks/common/post-receive" - ln -s -f $gitolite_hook $project_hook + ln -s -f $gitolite_hook $project_hook + fi + done + fi fi done |