From 2a269f42b2a3cb0ff71d101d044540e6c515669b Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 5 Jan 2018 13:49:06 +0100 Subject: Match "new mode" as well as "new file mode" in permissions check The permissions check was only looking at "new file mode", which is only present for new files. For existing files, when they change mode, the line says "new mode" instead. So match that, too. This catches what qtbase/ffc8409aa58c04c1dd140001976b55925ac959f6 did wrong. Change-Id: I07b30c1b88c067c3f90888ff3b212b15a9384134 Reviewed-by: Oswald Buddenhagen --- git-hooks/sanitize-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit index ca6879e..825ccba 100755 --- a/git-hooks/sanitize-commit +++ b/git-hooks/sanitize-commit @@ -812,7 +812,7 @@ while () { } next; } - if (/^new file mode (\d+)$/) { + if (/^new(?: file)? mode (\d+)$/) { my $text = $1; if ($text eq "160000" || $text eq "120000") { $is_special = 1; -- cgit v1.2.3