]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
checksrc-all.pl: do not check files multiple times rc-8_21_0-2
authorViktor Szakats <commit@vsz.me>
Mon, 8 Jun 2026 11:56:49 +0000 (13:56 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 8 Jun 2026 12:59:47 +0000 (14:59 +0200)
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

index 5b1cba7af624c3bca0f5e7d8d865c20ac68ca2fd..5982384fe115725f57b220fbc1201d30d9db7ff2 100755 (executable)
@@ -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, <O>; close(O);
+        open(O, '-|', 'git', 'ls-files', ":(glob)$dir/*.[ch]") || die; push @files, <O>; close(O);
         chomp(@files);
     }
     else {