[libcode-tidyall-perl] 296/374: don't process blank or single-line (possibly symlink) files
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 22:26:38 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libcode-tidyall-perl.
commit e039aaac63b33e2e28b20e2aefa96b8ecc00e2b5
Author: Jonathan Swartz <swartz at pobox.com>
Date: Tue Oct 2 15:31:07 2012 -0700
don't process blank or single-line (possibly symlink) files
---
lib/Code/TidyAll/Git/Prereceive.pm | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/Code/TidyAll/Git/Prereceive.pm b/lib/Code/TidyAll/Git/Prereceive.pm
index 07b96b3..a3a3791 100644
--- a/lib/Code/TidyAll/Git/Prereceive.pm
+++ b/lib/Code/TidyAll/Git/Prereceive.pm
@@ -57,7 +57,9 @@ sub check_input {
my @files = $self->get_changed_files( $base, $commit );
foreach my $file (@files) {
my $contents = $self->get_file_contents( $file, $commit );
- push( @results, $tidyall->process_source( $contents, $file ) );
+ if ( $contents =~ /\S/ && $contents =~ /\n/ ) {
+ push( @results, $tidyall->process_source( $contents, $file ) );
+ }
}
}
@@ -82,9 +84,6 @@ sub create_tidyall {
foreach my $rel_file ( $conf_file, @{ $self->extra_conf_files } ) {
my $contents = $self->get_file_contents( $rel_file, $commit )
or die sprintf( "could not find file '%s' in repo root", $rel_file );
- if ( $contents =~ /\S/ && $contents =~ /\n/ ) {
- write_file( "$temp_dir/$rel_file", $contents );
- }
}
my $tidyall = $self->tidyall_class->new_from_conf_file(
"$temp_dir/" . $conf_file,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git
More information about the Pkg-perl-cvs-commits
mailing list