path: root/contrib
diff options
authorDenton Liu <>2019-12-20 18:45:01 (GMT)
committerJunio C Hamano <>2019-12-20 20:40:52 (GMT)
commit6579d93a9789448c54203939650ca24409635f80 (patch)
treeff0852be63c3f70ada5afd44ca9ec596bcd90f55 /contrib
parent1c78c78d2513eaf22105c87484c65b4eecdf0bfc (diff)
contrib/credential/netrc: work outside a repo
Currently, git-credential-netrc does not work outside of a git repository. It fails with the following error: fatal: Not a git repository: . at /usr/share/perl5/ line 214. There is no real reason why need to be within a repository, though. Credential helpers should be able to work just fine outside the repository as well. Call the non-self version of config() so that git-credential-netrc no longer needs to be run within a repository. Signed-off-by: Denton Liu <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'contrib')
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/credential/netrc/git-credential-netrc.perl b/contrib/credential/netrc/git-credential-netrc.perl
index ebfc123..bc57cc6 100755
--- a/contrib/credential/netrc/git-credential-netrc.perl
+++ b/contrib/credential/netrc/git-credential-netrc.perl
@@ -423,7 +423,7 @@ sub load_config {
# load settings from git config
my $options = shift;
# set from command argument, gpg.program option, or default to gpg
- $options->{'gpg'} //= Git->repository()->config('gpg.program')
+ $options->{'gpg'} //= Git::config('gpg.program')
// 'gpg';
log_verbose("using $options{'gpg'} for GPG operations");