Skip to content

Commit cf22247

Browse files
committed
Merge branch 'tz/cred-netrc-cleanup'
Build and test procedure for netrc credential helper (in contrib/) has been updated. * tz/cred-netrc-cleanup: git-credential-netrc: make "all" default target of Makefile git-credential-netrc: fix exit status when tests fail git-credential-netrc: use in-tree Git.pm for tests git-credential-netrc: minor whitespace cleanup in test script
2 parents 1840443 + 04542b6 commit cf22247

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

contrib/credential/netrc/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The default target of this Makefile is...
2+
all::
3+
14
test:
25
./t-git-credential-netrc.sh
36

contrib/credential/netrc/t-git-credential-netrc.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@
1717
# set up test repository
1818

1919
test_expect_success \
20-
'set up test repository' \
21-
'git config --add gpg.program test.git-config-gpg'
20+
'set up test repository' \
21+
'git config --add gpg.program test.git-config-gpg'
2222

2323
# The external test will outputs its own plan
2424
test_external_has_tap=1
2525

26+
export PERL5LIB="$GITPERLLIB"
2627
test_external \
27-
'git-credential-netrc' \
28-
perl "$TEST_DIRECTORY"/../contrib/credential/netrc/test.pl
28+
'git-credential-netrc' \
29+
perl "$GIT_BUILD_DIR"/contrib/credential/netrc/test.pl
2930

3031
test_done
3132
)

contrib/credential/netrc/test.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/perl
2-
use lib (split(/:/, $ENV{GITPERLLIB}));
32

43
use warnings;
54
use strict;
@@ -12,7 +11,6 @@ BEGIN
1211
# t-git-credential-netrc.sh kicks off our testing, so we have to go
1312
# from there.
1413
Test::More->builder->current_test(1);
15-
Test::More->builder->no_ending(1);
1614
}
1715

1816
my @global_credential_args = @ARGV;
@@ -104,6 +102,9 @@ BEGIN
104102

105103
ok(scalar keys %$cred == 2, 'Got keys decrypted by command option');
106104

105+
my $is_passing = eval { Test::More->is_passing };
106+
exit($is_passing ? 0 : 1) unless $@ =~ /Can't locate object method/;
107+
107108
sub run_credential
108109
{
109110
my $args = shift @_;

0 commit comments

Comments
 (0)