From 4ec9b910c212d0d31816f10f1633078e7500321a Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Mon, 26 Jul 2021 15:45:37 +0000 Subject: [PATCH] [TOOLS] Fix pre commit hook to allow for partial file commits (git add -p/git reset -p) --- bin/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pre-commit b/bin/pre-commit index 4b240bbfda..46fb272a3d 100755 --- a/bin/pre-commit +++ b/bin/pre-commit @@ -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"