From: Benjamin C Meyer Date: Sat, 19 Jun 2010 20:10:43 +0000 (-0400) Subject: When listing hooks use GITDIR and pipe stderr to dev/null X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=92eeee246251f7247c765814ea69bbecaf961f0a;p=git-hooks.git When listing hooks use GITDIR and pipe stderr to dev/null Signed-off-by: Benjamin C Meyer --- diff --git a/git-hooks b/git-hooks index 44f706d..171a916 100755 --- a/git-hooks +++ b/git-hooks @@ -111,10 +111,9 @@ git-hooks run "$0" "$@"' > "${file}" function list_hooks { - while [ ! -d ".git" ] ; do - cd .. - done - cat .git/hooks/pre-commit | grep 'git-hooks' > /dev/null 2> /dev/null + GITDIR=`git rev-parse --git-dir` + cd $GITDIR + cat hooks/pre-commit 2> /dev/null | grep 'git-hooks' > /dev/null 2> /dev/null if [ $? = 0 ] ; then echo "Git hooks ARE installed in this repository." echo ""