[TOOLS] Fix pre commit hook to allow for partial file commits (git add -p/git reset -p)

This commit is contained in:
Hugo Sales 2021-07-26 15:45:37 +00:00
parent cc0ef73799
commit 835a3c6701

View File

@ -3,7 +3,7 @@
root="$(git rev-parse --show-toplevel)"
# get the list of changed files
staged_files="$(git diff --cached --name-only)"
staged_files="$(git status --porcelain | sed -rn "s/^[^ ][ ] (.*)/\1/p")"
echo "Running php-cs-fixer on edited files"