diff options
author | Sitaram Chamarty <sitaram@atc.tcs.com> | 2017-05-30 10:30:48 +0530 |
---|---|---|
committer | Sitaram Chamarty <sitaram@atc.tcs.com> | 2017-05-30 19:11:22 +0530 |
commit | 8bde76d0ae029c2ed09ca8895f224ca64c836a57 (patch) | |
tree | 186e69b37b2bec2be569c8ef7d79a038dbbbeef6 | |
parent | fix inefficiency in repo-specific hooks (diff) | |
download | gitolite-gentoo-8bde76d0ae029c2ed09ca8895f224ca64c836a57.tar.gz gitolite-gentoo-8bde76d0ae029c2ed09ca8895f224ca64c836a57.tar.bz2 gitolite-gentoo-8bde76d0ae029c2ed09ca8895f224ca64c836a57.zip |
allow repo-specific hooks to be organised into subdirectories
(thanks to Mathieu Arnold for catching this, and for an initial patch)
-rwxr-xr-x | src/triggers/repo-specific-hooks | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/triggers/repo-specific-hooks b/src/triggers/repo-specific-hooks index 631066e..bba7a58 100755 --- a/src/triggers/repo-specific-hooks +++ b/src/triggers/repo-specific-hooks @@ -73,7 +73,12 @@ for my $repo (keys %repo_hooks) { } my $src = $rc{LOCAL_CODE} . "/hooks/repo-specific/$code"; + + # if $code has slashes in it, flatten it for use in $dst, to avoid + # having to re-create those intermediate sub-directories + $code =~ s(/)(_)g; my $dst = "$repo.git/hooks/$hook.$counter-$code"; + unless ( -x $src ) { _warn "repo-specific-hooks: '$src' doesn't exist or is not executable"; next; |