From 2dfd265d668eb184a0feb0cbda5357fb076d9f0d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 8 Jun 2026 13:56:49 +0200 Subject: [PATCH] checksrc-all.pl: do not check files multiple times Restrict `git ls-files` to return `*.[ch]` files within `$dir` only. Before this patch it returned files in subdirectories too, which did double work and may have made `checksrc.pl` pick `.checksrc` from the first such subdirectory, masking the one in `$dir`. (current curl tree is not affected) Ref: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec Follow-up to 33f606cd51995b68a0f68ac478f7395d8acda17b #20439 Closes #21909 --- scripts/checksrc-all.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checksrc-all.pl b/scripts/checksrc-all.pl index 5b1cba7af6..5982384fe1 100755 --- a/scripts/checksrc-all.pl +++ b/scripts/checksrc-all.pl @@ -34,7 +34,7 @@ my $anyfailed = 0; for my $dir (@dirs) { if($is_git) { @files = (); - open(O, '-|', 'git', 'ls-files', "$dir/*.[ch]") || die; push @files, ; close(O); + open(O, '-|', 'git', 'ls-files', ":(glob)$dir/*.[ch]") || die; push @files, ; close(O); chomp(@files); } else {