util/gitconfig: improve robustness of checkpatch in pre-commit

Users can have non-default configurations as to how git diff et al are
presenting file names in diffs (default: a/ and b/ prefixes). checkpatch
expects that and trims the first element, so enforce that configuration
for the diff that's sent into it.

Change-Id: I099795119456a73c900b31ce191c2d9e898a5c7e
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/26694
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Patrick Georgi 2018-05-30 15:48:16 +02:00 committed by Patrick Georgi
parent f6081c2deb
commit 9110c17668
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ set -u # -o nounset
%MAKE% lint-stable %MAKE% lint-stable
PATCHDIFF=$(git diff --cached) PATCHDIFF=$(git diff --cached --src-prefix=a/ --dst-prefix=b/)
if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then
echo echo
echo "Running checkpatch" echo "Running checkpatch"