git-credential-netrc: fix exit status when tests fail
authorLuis Marsano <luis.marsano@gmail.com>
Wed, 13 Jun 2018 03:10:39 +0000 (23:10 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Jun 2018 15:44:41 +0000 (08:44 -0700)
Signed-off-by: Luis Marsano <luis.marsano@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/credential/netrc/test.pl
index 2b5280ad6a580105259247c9419c0fe30b11f163..c0fb3718b280c70316941de7617871360b724525 100755 (executable)
@@ -11,7 +11,6 @@ BEGIN
        # t-git-credential-netrc.sh kicks off our testing, so we have to go
        # from there.
        Test::More->builder->current_test(1);
-       Test::More->builder->no_ending(1);
 }
 
 my @global_credential_args = @ARGV;
@@ -103,6 +102,9 @@ BEGIN
 
 ok(scalar keys %$cred == 2, 'Got keys decrypted by command option');
 
+my $is_passing = eval { Test::More->is_passing };
+exit($is_passing ? 0 : 1) unless $@ =~ /Can't locate object method/;
+
 sub run_credential
 {
        my $args = shift @_;