git-credential-netrc: fix exit status when tests fail

Signed-off-by: Luis Marsano <luis.marsano@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Luis Marsano committed Jun 12, 2018 at 23:10 UTC 9347166d5d4a07d20e32f45b92435bb788425f1e
1 file changed +3 -1
contrib/credential/netrc/test.pl
+3 -1
@@ -11,7 +11,6 @@ BEGIN {
11 # t-git-credential-netrc.sh kicks off our testing, so we have to go
12 # from there.
13 Test::More->builder->current_test(1);
14 - Test::More->builder->no_ending(1);
14 }
15
16 my @global_credential_args = @ARGV;
@@ -103,6 +102,9 @@ $cred = run_credential( ['-f', $netrcGpg, '-g', 'test.command-option-gpg', 'get'
102
103 ok(scalar keys %$cred == 2, 'Got keys decrypted by command option');
104
105 +my $is_passing = eval { Test::More->is_passing };
106 +exit($is_passing ? 0 : 1) unless $@ =~ /Can't locate object method/;
107 +
108 sub run_credential
109 {
110 my $args = shift @_;