From 51eb63805b0f975d26fdebc1726366ebc7e13a35 Mon Sep 17 00:00:00 2001 From: Benjamin C Meyer Date: Sat, 19 Jun 2010 16:17:26 -0400 Subject: When listing hooks don't change the cwd, just use the GITDIR variable Signed-off-by: Benjamin C Meyer --- git-hooks | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-hooks b/git-hooks index 0acc6e3..6f08899 100755 --- a/git-hooks +++ b/git-hooks @@ -114,8 +114,7 @@ git-hooks run "$0" "$@"' > "${file}" function list_hooks { GITDIR=`git rev-parse --git-dir` - cd $GITDIR - cat hooks/pre-commit 2> /dev/null | grep 'git-hooks' > /dev/null 2> /dev/null + cat $GITDIR/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 "" -- cgit v1.2.3