[libcode-tidyall-perl] 155/374: only return files (not directories) from svn_uncommitted_files

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 22:26:09 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 5dd898e109d2f55754538fd1e3a4ad4481f5769b
Author: Jonathan Swartz <swartz at pobox.com>
Date:   Fri Aug 24 17:55:57 2012 -0700

    only return files (not directories) from svn_uncommitted_files
---
 lib/Code/TidyAll/SVN/Util.pm |    2 +-
 lib/Code/TidyAll/t/SVN.pm    |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/Code/TidyAll/SVN/Util.pm b/lib/Code/TidyAll/SVN/Util.pm
index 57d6668..7d5be53 100644
--- a/lib/Code/TidyAll/SVN/Util.pm
+++ b/lib/Code/TidyAll/SVN/Util.pm
@@ -13,7 +13,7 @@ sub svn_uncommitted_files {
     $dir = realpath($dir);
     my $output = capturex( "svn", "status", $dir );
     my @lines = grep { /^[AM]/ } split( "\n", $output );
-    my (@files) = ( $output =~ m{^[AM]\s+(.*)$}gm );
+    my (@files) = grep { -f } ( $output =~ m{^[AM]\s+(.*)$}gm );
     return @files;
 }
 
diff --git a/lib/Code/TidyAll/t/SVN.pm b/lib/Code/TidyAll/t/SVN.pm
index cc5c273..ce24f15 100644
--- a/lib/Code/TidyAll/t/SVN.pm
+++ b/lib/Code/TidyAll/t/SVN.pm
@@ -57,10 +57,13 @@ sub test_svn : Tests {
     chmod( 0775, $precommit_hook_file );
 
     write_file( "$work_dir/foo.txt", "abc " );
+    mkpath( "$work_dir/bar", 0, 0775 );
+    run( sprintf( 'svn add %s/bar', $work_dir ) );
     cmp_deeply( [ svn_uncommitted_files($work_dir) ], [ re("foo.txt") ], "one uncommitted file" );
 
-    $stderr =
-      capture_stderr { run( sprintf( 'svn -q commit -m "changed" %s/foo.txt', $work_dir ) ) };
+    $stderr = capture_stderr {
+        run( sprintf( 'svn -q commit -m "changed" %s/foo.txt %s/bar', $work_dir, $work_dir ) );
+    };
     unlike( $stderr, qr/\S/ );
     $log_contains->(qr|could not find 'tidyall.ini' upwards from 'myapp/trunk/foo.txt'|);
     $clear_log->();

-- 
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