Skip to content

Commit b4fcd38

Browse files
committed
Simplify whitespace purge script a little.
Do not need to test with -f. If directories ever show up in git ls-files (unlikely) their mime type is application/x-directory which will fail the test ${file::4} == text check. Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 92ec9ca commit b4fcd38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/whitespace-purge.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ for file in $(git ls-files) ; do
1717
# skip sym links, pdfs, etc. If any other file types should be
1818
# skipped add the check here.
1919
type=$(file -b --mime-type -h $file)
20-
if test -f $file && test ${type::4} == "text" ; then
20+
if test ${type::4} == "text" ; then
2121
LC_ALL=C sed -i '' -E "s/[[:space:]]*$//" $file
2222
fi
2323
done

0 commit comments

Comments
 (0)