Skip to content

Commit 916f904

Browse files
committed
Properly support files with spaces in name
This patch addresses a bug which caused the hook(s) to fail if the filename had a space in it by settings the IFS to accept spaces. Fixes: #10
1 parent 7d12833 commit 916f904

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ if [ -f "$git_root/.git" ]; then
2828
fi
2929
fi
3030

31+
SAVEIFS=$IFS
32+
IFS=$(echo -en "\n\b")
33+
3134
for changedfile in `git diff --cached --name-only --diff-filter=ACM`; do
3235
#check puppet manifest syntax
3336
if type puppet >/dev/null 2>&1; then
@@ -81,6 +84,7 @@ for changedfile in `git diff --cached --name-only --diff-filter=ACM`; do
8184
echo "puppet-lint not installed. Skipping puppet-lint tests..."
8285
fi
8386
done
87+
IFS=$SAVEIFS
8488

8589
#rspec test validation
8690
if which rspec >/dev/null 2>&1; then

0 commit comments

Comments
 (0)