diff options
author | Benjamin C Meyer <ben@meyerhome.net> | 2014-02-17 22:25:10 -0500 |
---|---|---|
committer | Benjamin C Meyer <ben@meyerhome.net> | 2014-02-17 22:25:10 -0500 |
commit | 6aa63a32a404850e2e20b9229a0a7fe8f6096fa8 (patch) | |
tree | 5cf7dc84d35d499ac7f62eccf0a79326c4586ef6 | |
parent | b21f0c9515e3ba14e13485f8b967e141334828b5 (diff) | |
download | git-hooks-6aa63a32a404850e2e20b9229a0a7fe8f6096fa8.tar.gz git-hooks-6aa63a32a404850e2e20b9229a0a7fe8f6096fa8.tar.bz2 |
Handle repository paths that contains spaces
Issue #33
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
-rwxr-xr-x | git-hooks | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2010-2013, Benjamin C. Meyer <ben@meyerhome.net> +# Copyright (c) 2010-2014, Benjamin C. Meyer <ben@meyerhome.net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -119,7 +119,7 @@ function install_hooks echo "$1 must be run inside a git repository" return 1 fi - cd $GITDIR + cd "${GITDIR}" if [ "${1}" = "--install" ] ; then if [ -d hooks.old ] ; then echo "hooks.old already exists, perhaps you already installed?" @@ -141,7 +141,7 @@ git-hooks run "$0" "$@"'; function list_hooks { GITDIR=`git rev-parse --git-dir` - cat $GITDIR/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 "" |