mirror of
https://github.com/git/git
synced 2024-08-28 20:20:07 +00:00
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>
This commit is contained in:
parent
1c78c78d25
commit
6579d93a97
|
@ -423,7 +423,7 @@ sub load_config {
|
||||||
# load settings from git config
|
# load settings from git config
|
||||||
my $options = shift;
|
my $options = shift;
|
||||||
# set from command argument, gpg.program option, or default to gpg
|
# 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';
|
// 'gpg';
|
||||||
log_verbose("using $options{'gpg'} for GPG operations");
|
log_verbose("using $options{'gpg'} for GPG operations");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue