summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/perl/t/porting/pending-author.t24
1 files changed, 14 insertions, 10 deletions
diff --git a/gnu/usr.bin/perl/t/porting/pending-author.t b/gnu/usr.bin/perl/t/porting/pending-author.t
index 883e5343345..6bc392b35c6 100644
--- a/gnu/usr.bin/perl/t/porting/pending-author.t
+++ b/gnu/usr.bin/perl/t/porting/pending-author.t
@@ -23,25 +23,29 @@
BEGIN {
@INC = '..' if -f '../TestInit.pm';
}
-use TestInit qw(T); # T is chdir to the top level
+use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
use strict;
-use File::Spec;
-require './t/test.pl';
+require 't/test.pl';
find_git_or_skip('all');
-my $devnull = File::Spec->devnull;
-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;
+my $changes;
+foreach (`git status --porcelain 2>/dev/null`) {
+ next if /^\?\?/;
+ ++$changes;
+ last;
+}
+
+skip_all("No pending changes (or git status --porcelain doesn't work here)")
+ unless $changes;
sub get {
my $key = shift;
my $value = `git config --get user.$key`;
unless (defined $value && $value =~ /\S/) {
- skip_all("git config --get user.$key returned nought");
+ plan(1);
+ like($value, qr/\S/, "git config --get user.$key returned a value");
+ exit 1;
}
chomp $value;
return $value;