]> gitweb.fluxo.info Git - git-hooks.git/commit
Fix too many hooks reported in list_hooks_in_dir
authorGeorg Lutz <georg@georglutz.de>
Sat, 24 Aug 2013 18:17:11 +0000 (20:17 +0200)
committerBenjamin C Meyer <ben@meyerhome.net>
Mon, 21 Oct 2013 02:14:26 +0000 (22:14 -0400)
commit187f23820f43e962acbeab788d5a96d5d59bd51e
tree6dab2087cbcc058d08cb9927ebae996f0dbd8b8c
parent600bd81f37a059c4a16eb48fa8838750bea48e5a
Fix too many hooks reported in list_hooks_in_dir

list_hooks_in_dir should report exactly the hooks that would be run with
run_hooks. But the find command in list_hooks_in_dir does not limit itself to
the scheme "folder_name/hook_name" but recurses infinitely through sub
directories reporting all executable files. If your hooks are stored itself in
a git repository then consequently also the files in .git/hooks are reported.

This change sets the search depth exactly to two, so that the correct scripts
are reported, e.g. :
    ~/.git_hooks/commit-msg/script1

but not e.g. :

    ~/.git_hook/.git/hooks/commit-msg
    ~/.git_hooks/script2
    ~/.git_hooks/commit-msg/dir2/script3

Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
git-hooks