Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

When listing hooks use GITDIR and pipe stderr to dev/null

Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
  • Loading branch information...
commit 92eeee246251f7247c765814ea69bbecaf961f0a 1 parent f4c3eb9
@icefox authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 git-hooks
View
7 git-hooks
@@ -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 ""
Please sign in to comment.
Something went wrong with that request. Please try again.