]> gitweb.fluxo.info Git - git-hooks.git/commitdiff
When listing hooks don't change the cwd, just use the GITDIR variable
authorBenjamin C Meyer <ben@meyerhome.net>
Sat, 19 Jun 2010 20:17:26 +0000 (16:17 -0400)
committerBenjamin C Meyer <ben@meyerhome.net>
Sat, 19 Jun 2010 20:17:26 +0000 (16:17 -0400)
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
git-hooks

index 0acc6e3cfca18383307bf7733476b0dc17502139..6f08899aee4841c9c2df819709f74d6d09d76d6a 100755 (executable)
--- 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 ""