]> git.ipfire.org Git - thirdparty/git.git/commit
hooks--pre-commit: detect non-ASCII when renaming
authorJulian Prein <druckdev@protonmail.com>
Thu, 30 Nov 2023 16:13:56 +0000 (16:13 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 3 Dec 2023 02:55:40 +0000 (11:55 +0900)
commitd9fd71fa2a82da40a9b58c4ecbc49aed06cb8953
treed8a547c7a5a497dfbc8793eaecc34c8ac7a3e2dd
parentec583449067bab5b800ecc63926f35c9dae96fa1
hooks--pre-commit: detect non-ASCII when renaming

When diff.renames is turned on, the diff-filter will not return renamed
files (or copied ones with diff.renames=copy) and potential non-ASCII
characters would not be caught by this hook.

Use the plumbing command diff-index instead of the porcelain one to not
be affected by diff.rename.

Signed-off-by: Julian Prein <druckdev@protonmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
templates/hooks--pre-commit.sample