From 9f60880207c6c7d00a2e4e4d904ef720de58f45b Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 1 Jan 2012 17:56:51 -0500 Subject: [PATCH] Fix Perl copyright script to skip .git subdirectory; running it on those files corrupts the index. --- src/tools/copyright.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tools/copyright.pl b/src/tools/copyright.pl index 08e5f5e39d..9c591e8fb1 100755 --- a/src/tools/copyright.pl +++ b/src/tools/copyright.pl @@ -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;