Permalink
Browse files

Only set the hook variable when an argument is passed to hook_dirs, o…

…therwise hook will be '/' and if there is no git config option will result in / being returned as a valid git hook which it is not

Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
  • Loading branch information...
1 parent b25ce6e commit 4c1dd86f9edd291bfcdfc3c636f53d25dddc3928 @icefox committed Jun 19, 2010
Showing with 8 additions and 4 deletions.
  1. +8 −4 git-hooks
View
@@ -28,10 +28,14 @@
function hook_dirs
{
- hook="${1}"
- echo "${HOME}/.git_hooks/${hook}"
- echo "${PWD}/git_hooks/${hook}"
- echo "`git config hooks.global`"/${hook}
+ if [ ! -z "${1}" ] ; then
+ hook="/${1}"
+ else
+ hook=""
+ fi
+ echo "${HOME}/.git_hooks${hook}"
+ echo "${PWD}/git_hooks${hook}"
+ echo "`git config hooks.global`"${hook}
}
function list_hooks_in_dir

0 comments on commit 4c1dd86

Please sign in to comment.