This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/porting/checkcase.t shouldn't scan .git for case-clashing files.
authorNicholas Clark <nick@ccl4.org>
Thu, 31 May 2012 09:28:21 +0000 (11:28 +0200)
committerNicholas Clark <nick@ccl4.org>
Thu, 31 May 2012 09:32:07 +0000 (11:32 +0200)
The contents of the .git directory are outside our control. In particular,
as fetch doesn't default to --prune, someone pushing a branch upstream with
a name which case-conflicts with a previously deleted branch will cause
action-at-a-distance failures, because locally .git/logs/refs/remotes will
contain both.

t/porting/checkcase.t

index edaeb60..aa298b3 100644 (file)
@@ -21,6 +21,17 @@ find(sub {
           # Special exemption for Makefile, makefile
           return if $name =~ m!\A(?:x2p/)?[Mm]akefile\z!;
 
+          if ($name eq '.git') {
+              # Don't scan the .git directory, as its contents are outside
+              # our control. In particular, as fetch doesn't default to
+              # --prune, # someone pushing a branch upstream with a name
+              # which case-conflicts with a previously deleted branch will
+              # cause action-at-a-distance failures, because locally
+              # .git/logs/refs/remotes will contain both.
+              ++$File::Find::prune;
+              return;
+          }
+
           push @{$files{lc $name}}, $name;
         }, '.');