Skip to content

Commit 6579d93

Browse files
Denton-Lgitster
authored andcommitted
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/Git.pm 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 <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1c78c78 commit 6579d93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/credential/netrc/git-credential-netrc.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ sub load_config {
423423
# load settings from git config
424424
my $options = shift;
425425
# set from command argument, gpg.program option, or default to gpg
426-
$options->{'gpg'} //= Git->repository()->config('gpg.program')
426+
$options->{'gpg'} //= Git::config('gpg.program')
427427
// 'gpg';
428428
log_verbose("using $options{'gpg'} for GPG operations");
429429
}

0 commit comments

Comments
 (0)