added support for a post-repo-create hook (gl-post-init)

...some people want to run a special function after a repo is created
This commit is contained in:
Sitaram Chamarty 2010-09-24 16:19:33 +05:30
parent c18514e213
commit 67a72a3f5b
3 changed files with 91 additions and 68 deletions

View file

@ -294,6 +294,12 @@ sub new_repo
# override with the package hooks
ln_sf("$GL_PACKAGE_HOOKS/common", "*", "hooks") if $GL_PACKAGE_HOOKS;
chmod 0755, "hooks/update";
# run gitolite's post-init hook if you can. GL_REPO will be correct on a
# wildcard create but on a normal (config file) create it will actually be
# set to "gitolite-admin", so we need to make sure that for the duration
# of the hook it is set correctly.
system("env GL_REPO='$repo' hooks/gl-post-init") if -x "hooks/gl-post-init";
}
# ----------------------------------------------------------------------------