This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/porting/pending-author.t: report skip reasons more carefully
authorAaron Crane <arc@cpan.org>
Thu, 19 Oct 2017 09:48:30 +0000 (10:48 +0100)
committerAaron Crane <arc@cpan.org>
Sun, 22 Oct 2017 10:01:42 +0000 (11:01 +0100)
t/porting/pending-author.t

index 0aaa546..883e534 100644 (file)
@@ -31,15 +31,11 @@ require './t/test.pl';
 find_git_or_skip('all');
 
 my $devnull = File::Spec->devnull;
-my $changes;
-foreach (`git status --porcelain 2>$devnull`) {
-    next if /^\?\?/;
-    ++$changes;
-    last;
-}
-
-skip_all("No pending changes (or git status --porcelain doesn't work here)")
-    unless $changes;
+my @lines = `git status --porcelain 2>$devnull`;
+skip_all("git status --porcelain doesn't seem to work here")
+    if $? != 0;
+skip_all("No pending changes")
+    if !grep !/^\?\?/, @lines;
 
 sub get {
     my $key = shift;