# set up test repository
 
        test_expect_success \
-    'set up test repository' \
-    :
+               'set up test repository' \
+               'git config --add gpg.program test.git-config-gpg'
 
        # The external test will outputs its own plan
        test_external_has_tap=1
 
+       export PERL5LIB="$GITPERLLIB"
        test_external \
-    'git-credential-netrc' \
-    perl "$TEST_DIRECTORY"/../contrib/credential/netrc/test.pl
+               'git-credential-netrc' \
+               perl "$GIT_BUILD_DIR"/contrib/credential/netrc/test.pl
 
        test_done
 )