Commit 30d6370719263da531d2405fb561d34e1340f49e
1 parent
83924495
Exists in
master
and in
4 other branches
Add subdir support for rewrite-hooks script
Showing
1 changed file
with
16 additions
and
3 deletions
Show diff stats
lib/support/rewrite-hooks.sh
@@ -11,9 +11,22 @@ do | @@ -11,9 +11,22 @@ do | ||
11 | continue | 11 | continue |
12 | fi | 12 | fi |
13 | 13 | ||
14 | - project_hook="$src/$dir/hooks/post-receive" | ||
15 | - gitolite_hook="/home/git/.gitolite/hooks/common/post-receive" | 14 | + if [[ "$dir" =~ ^.*.git$ ]] |
15 | + then | ||
16 | + project_hook="$src/$dir/hooks/post-receive" | ||
17 | + gitolite_hook="/home/git/.gitolite/hooks/common/post-receive" | ||
18 | + | ||
19 | + ln -s -f $gitolite_hook $project_hook | ||
20 | + else | ||
21 | + for subdir in `ls "$src/$dir/"` | ||
22 | + do | ||
23 | + if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*.git$ ]]; then | ||
24 | + project_hook="$src/$dir/$subdir/hooks/post-receive" | ||
25 | + gitolite_hook="/home/git/.gitolite/hooks/common/post-receive" | ||
16 | 26 | ||
17 | - ln -s -f $gitolite_hook $project_hook | 27 | + ln -s -f $gitolite_hook $project_hook |
28 | + fi | ||
29 | + done | ||
30 | + fi | ||
18 | fi | 31 | fi |
19 | done | 32 | done |