diff options
author | Jeff King <peff@peff.net> | 2012-08-21 02:31:52 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-08-21 14:47:07 -0700 |
commit | 11e50b2736f374f1608e0c5690405be1a74aa16d (patch) | |
tree | 2c923bca5acd02162d066d17b19a5d430e0e0b09 /attr.c | |
parent | 6966073102170171da4c25a4038bbd143fa6a75b (diff) | |
download | git-11e50b2736f374f1608e0c5690405be1a74aa16d.tar.gz |
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'attr.c')
-rw-r--r-- | attr.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); |