Browse files

fork ADC: stop carrying along non-gitolite hooks

When someone adds a repo-specific hook to their repo, then create a
'fork' via the fork ADC, this repo-specific hook also get carried
across, but should not.
  • Loading branch information...
1 parent a6ab6cd commit d3b2dda5df442e543197d4349cf6d85a885d744d @sitaramc committed Feb 29, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 contrib/adc/fork
@@ -24,7 +24,15 @@ echo $GL_USER > gl-creater
git config gitweb.owner "$GL_USER"
SSH_ORIGINAL_COMMAND="setperms $to" $GL_BINDIR/gl-auth-command $GL_USER
-cp -R $GL_REPO_BASE_ABS/$from.git/hooks/* $GL_REPO_BASE_ABS/$to.git/hooks
+# symlink hooks
+shopt -s nullglob
+# the order is important; "package" hooks must override same-named "user" hooks
+for i in `$GL_BINDIR/gl-query-rc GL_ADMINDIR`/hooks/common/* \
+ `$GL_BINDIR/gl-query-rc GL_PACKAGE_HOOKS `/common/*
+ ln -sf $i $GL_REPO_BASE_ABS/$to.git/hooks
if [ -n "$GL_WILDREPOS_DEFPERMS" ]; then
echo "$GL_WILDREPOS_DEFPERMS" > gl-perms

0 comments on commit d3b2dda

Please sign in to comment.