diff options
author | Benjamin C Meyer <ben@meyerhome.net> | 2010-06-19 16:10:43 -0400 |
---|---|---|
committer | Benjamin C Meyer <ben@meyerhome.net> | 2010-06-19 16:10:43 -0400 |
commit | 92eeee246251f7247c765814ea69bbecaf961f0a (patch) | |
tree | e0baddeb95313f956aad8e454269b113c7331ac3 | |
parent | f4c3eb901856581d1441ba3b3a6698bae6fbb4f3 (diff) | |
download | git-hooks-92eeee246251f7247c765814ea69bbecaf961f0a.tar.gz git-hooks-92eeee246251f7247c765814ea69bbecaf961f0a.tar.bz2 |
When listing hooks use GITDIR and pipe stderr to dev/null
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
-rwxr-xr-x | git-hooks | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 "" |