From mboxrd@z Thu Jan 1 00:00:00 1970 From: list at eworm.de (Christian Hesse) Date: Wed, 9 Mar 2016 11:16:35 +0100 Subject: [PATCH v2 1/1] scan-tree: handle error in git_config_from_file() In-Reply-To: <1457445106-17365-1-git-send-email-list@eworm.de> References: <1457445106-17365-1-git-send-email-list@eworm.de> Message-ID: <1457518595-9412-1-git-send-email-list@eworm.de> From: Christian Hesse We can live without config, but print an error if it is not readable. --- scan-tree.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scan-tree.c b/scan-tree.c index 2e87999..bc17d14 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -121,7 +121,10 @@ static void add_repo(const char *base, struct strbuf *path, repo_config_fn fn) config_fn = fn; if (ctx.cfg.enable_git_config) { strbuf_addstr(path, "config"); - git_config_from_file(gitconfig_config, path->buf, NULL); + if (git_config_from_file(gitconfig_config, path->buf, NULL)) { + fprintf(stderr, "Error reading config %s: %s (%d)\n", + path->buf, strerror(errno), errno); + } strbuf_setlen(path, pathlen); } -- 2.7.2