Permalink
Browse files

hooks: convert pre-commit to POSIX syntax

  • Loading branch information...
1 parent 0dfad00 commit 3925f4ff63d05b2c4cf2c1543152c8ecfa0beb10 @jbeich jbeich committed Oct 11, 2016
Showing with 3 additions and 3 deletions.
  1. +3 −3 hooks/pre-commit
View
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Enforce citra's whitespace policy
git config --local core.whitespace tab-in-indent,trailing-space
@@ -32,12 +32,12 @@ for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do
if ! echo "$f" | egrep -q "^src/"; then
continue
fi
- d=$(diff -u "$f" <(clang-format "$f"))
+ d=$(clang-format "$f" | diff -u "$f" -)
if ! [ -z "$d" ]; then
echo "!!! $f not compliant to coding style, here is the fix:"
echo "$d"
fail=1
fi
done
-exit "$fail"
+exit "${fail-0}"

0 comments on commit 3925f4f

Please sign in to comment.