]> granicus.if.org Git - postgresql/commitdiff
Fix Perl copyright script to skip .git subdirectory; running it on
authorBruce Momjian <bruce@momjian.us>
Sun, 1 Jan 2012 22:56:51 +0000 (17:56 -0500)
committerBruce Momjian <bruce@momjian.us>
Sun, 1 Jan 2012 22:56:51 +0000 (17:56 -0500)
those files corrupts the index.

src/tools/copyright.pl

index 08e5f5e39d46c873cc2589b93dd197f01f21d925..9c591e8fb1d4e5b88d33b5c5b66589bfa736bd37 100755 (executable)
@@ -2,7 +2,7 @@
 #################################################################
 # copyright.pl -- update copyright notices throughout the source tree, idempotently.
 #
-# Copyright (c) 2011, PostgreSQL Global Development Group
+# Copyright (c) 2011-2012, PostgreSQL Global Development Group
 #
 # src/tools/copyright.pl
 #################################################################
@@ -23,6 +23,13 @@ print "Using current year:  $year\n";
 find({wanted => \&wanted, no_chdir => 1}, '.');
 
 sub wanted {
+    # prevent corruption of git indexes, ./.git
+    if ($File::Find::name =~ m{^\./\.git$})
+    {
+       $File::Find::prune = 1;
+       return;
+    }
+
     return if ! -f $File::Find::name || -l $File::Find::name;
 
     my @lines;