setup: add gentle version of resolve_git_dir

This follows a93bedada (setup: add gentle version of read_gitfile,
2015-06-09), and assumes the same reasoning. resolve_git_dir is unsuited
for speculative calls, so we want to use the gentle version to find out
about potential errors.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller
2017-01-24 15:56:49 -08:00
committed by Junio C Hamano
parent 4e59582ff7
commit 40d9632514
2 changed files with 5 additions and 3 deletions

View File

@ -1017,11 +1017,11 @@ const char *setup_git_directory(void)
return setup_git_directory_gently(NULL);
}
const char *resolve_gitdir(const char *suspect)
const char *resolve_gitdir_gently(const char *suspect, int *return_error_code)
{
if (is_git_directory(suspect))
return suspect;
return read_gitfile(suspect);
return read_gitfile_gently(suspect, return_error_code);
}
/* if any standard file descriptor is missing open it to /dev/null */