From b348c917dd5e58d3bbeb1339f9593503c89d40a7 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 14 May 2017 13:22:37 +0200 Subject: [PATCH] Do not call git_pathdup if we have no repository libgit recently added stricter checks. Signed-off-by: Sven Strickroth --- ext/gitdll/gitdll.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/gitdll/gitdll.c b/ext/gitdll/gitdll.c index c49469bbf..1bef61b68 100644 --- a/ext/gitdll/gitdll.c +++ b/ext/gitdll/gitdll.c @@ -888,7 +888,7 @@ const wchar_t *wget_msysgit_etc(void) int git_get_config(const char *key, char *buffer, int size) { - char *local, *global, *globalxdg; + char *local = NULL, *global, *globalxdg; const char *home, *system, *programdata; struct config_buf buf; struct git_config_source config_source = { 0 }; @@ -916,9 +916,10 @@ int git_get_config(const char *key, char *buffer, int size) system = git_etc_gitconfig(); programdata = git_program_data_config(); - local = git_pathdup("config"); + if (have_git_dir()) + local = git_pathdup("config"); - if (!buf.seen) + if (local) { config_source.file = local; git_config_with_options(get_config, &buf, &config_source, &opts); -- 2.11.4.GIT