aboutsummaryrefslogtreecommitdiff
path: root/dev/tools/pre-commit
diff options
context:
space:
mode:
authorGaëtan Gilbert2018-04-17 13:19:30 +0200
committerGaëtan Gilbert2018-04-17 13:19:30 +0200
commit110b29143d36719fab627cc9e682a12743812b72 (patch)
tree4eaeb3810a54abde2df70314c0cac3ef322777cb /dev/tools/pre-commit
parenta34bd320aed7027c46021643cd2495baa0a17089 (diff)
parent7fcae05d6f1a03750d636a61a80d89e2cc6ce0cc (diff)
Merge PR #7278: pre-commit : do not fail miserably if git config has `apply.whitespace = fix`
Diffstat (limited to 'dev/tools/pre-commit')
-rwxr-xr-xdev/tools/pre-commit6
1 files changed, 3 insertions, 3 deletions
diff --git a/dev/tools/pre-commit b/dev/tools/pre-commit
index a514b8866a..b56925c370 100755
--- a/dev/tools/pre-commit
+++ b/dev/tools/pre-commit
@@ -27,8 +27,8 @@ then
# reset work tree and index
# NB: untracked files which were not added are untouched
- git apply --cached -R "$index"
- git apply -R "$tree"
+ git apply --whitespace=nowarn --cached -R "$index"
+ git apply --whitespace=nowarn -R "$tree"
# Fix index
# For end of file newlines we must go through the worktree
@@ -45,7 +45,7 @@ then
# making git fail. Don't fail now: we fix the worktree first.
if [ -s "$fixed_index" ]
then
- git apply -R "$fixed_index"
+ git apply --whitespace=nowarn -R "$fixed_index"
fi
# Fix worktree