Permalink
Browse files

When listing hooks don't change the cwd, just use the GITDIR variable

Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
  • Loading branch information...
1 parent 0f8f2c3 commit 51eb63805b0f975d26fdebc1726366ebc7e13a35 @icefox committed Jun 19, 2010
Showing with 1 addition and 2 deletions.
  1. +1 −2 git-hooks
View
3 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 ""

0 comments on commit 51eb638

Please sign in to comment.