aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin C Meyer <ben@meyerhome.net>2010-06-19 16:17:26 -0400
committerBenjamin C Meyer <ben@meyerhome.net>2010-06-19 16:17:26 -0400
commit51eb63805b0f975d26fdebc1726366ebc7e13a35 (patch)
tree30de64a90dfa1b79b62ddb2cfc3e3ae530c7fcc8
parent0f8f2c371a56636428208348f3bce36d6a63a371 (diff)
downloadgit-hooks-51eb63805b0f975d26fdebc1726366ebc7e13a35.tar.gz
git-hooks-51eb63805b0f975d26fdebc1726366ebc7e13a35.tar.bz2
When listing hooks don't change the cwd, just use the GITDIR variable
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
-rwxr-xr-xgit-hooks3
1 files changed, 1 insertions, 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 ""