From: Jeff King Date: Tue, 21 Aug 2012 06:31:52 +0000 (-0400) Subject: attr: warn on inaccessible attribute files X-Git-Tag: v1.7.12.1~2^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=11e50b2736f374f1608e0c5690405be1a74aa16d;p=git.git attr: warn on inaccessible attribute files Just like config and gitignore files, we silently ignore missing or inaccessible attribute files. An existent but inaccessible file is probably a configuration error, so let's warn the user. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/attr.c b/attr.c index b52efb55a..cab01b8b5 100644 --- a/attr.c +++ b/attr.c @@ -352,8 +352,11 @@ static struct attr_stack *read_attr_from_file(const char *path, int macro_ok) char buf[2048]; int lineno = 0; - if (!fp) + if (!fp) { + if (errno != ENOENT) + warning(_("unable to access '%s': %s"), path, strerror(errno)); return NULL; + } res = xcalloc(1, sizeof(*res)); while (fgets(buf, sizeof(buf), fp)) handle_attr_line(res, buf, path, ++lineno, macro_ok);