Skip to content

Commit 0f00e85

Browse files
committed
Exclude external subdirectory from clang-format pre-commit hook
1 parent 2ad0a66 commit 0f00e85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.githooks/pre-commit-clang-format

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ patch=`mktemp -p /tmp ${prefix}.XXXXXX.patch`
7272
$DELETE_OLD_PATCHES && rm -f /tmp/$prefix*.patch
7373

7474
# create one patch containing all changes to the files
75-
git diff-index --cached --diff-filter=ACMR --name-only $against -- | while read file;
75+
# exclude files under external
76+
git diff-index --cached --diff-filter=ACMR --name-only $against -- . ':!external' | while read file;
7677
do
7778
# ignore file if we do check for file extensions and the file
7879
# does not match any of the extensions specified in $FILE_EXTS

0 commit comments

Comments
 (0)