comparison mupdf-source/scripts/githooks/pre-commit @ 3:2c135c81b16c

MERGE: upstream PyMuPDF 1.26.4 with MuPDF 1.26.7
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:44:09 +0200
parents b50eed0cc0ef
children
comparison
equal deleted inserted replaced
0:6015a75abc2d 3:2c135c81b16c
1 #!/bin/bash
2 #
3 # pre-commit hook to fix whitespace errors
4 #
5 # Uses the core.whitespace or .gitattributes whitespace=... settings.
6 #
7 # see also: "man git-config" under core.whitespace
8 # see also: "man gitattributes"
9 #
10
11 PATCH=P.diff
12
13 if ! git diff --cached --check --quiet
14 then
15 git diff --cached > $PATCH
16 git apply --cached -R $PATCH
17 git apply --cached --whitespace=fix $PATCH
18 rm $PATCH
19 fi