[Hooks] pre-commit: Preserve CRLF line endings

Part of P0239, funded by Ember2528.
This commit is contained in:
nmlgc 2023-04-16 19:36:42 +02:00
parent c5e51e6cb2
commit ea8c4b85a4
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ fi
# Remove trailing commas from `public` directives. These crash on TASM32
# version 5.0, but work on later versions.
for f in `git diff-index --name-only --cached --diff-filter=ACMRX ${against} | grep \.asm$ -i`; do
if [ -n "$(sed -i -E 's/(public\s+[^;]+?),\s*(;.*)?$/\1\2/w /dev/stdout' "$f")" ]; then
if [ -n "$(sed -b -i -E 's/(public\s+[^;]+?),\s*(;.*)?$/\1\2/w /dev/stdout' "$f")" ]; then
echo "$f"': removed a trailing comma from a `public` line, please re-stage.'
exit 1
fi