diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-18 14:24:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-18 14:24:06 -0700 |
commit | 8ffc33135268aaac55d08f4261d63b01b1004fb4 (patch) | |
tree | 760925cec62ba0c38e433900211425dfb402a88d /attr.c | |
parent | 01f7d7f19f585e40af399acc307200d4b6acad25 (diff) | |
parent | 8e950dab86eafa8f4ea671fab593ca6210bc2e15 (diff) | |
download | git-8ffc33135268aaac55d08f4261d63b01b1004fb4.tar.gz git-8ffc33135268aaac55d08f4261d63b01b1004fb4.tar.xz |
Merge branch 'jk/config-warn-on-inaccessible-paths' into maint
The attribute system may be asked for a path that itself or its
leading directories no longer exists in the working tree, and it is
fine if we cannot open .gitattribute file in such a case. Failure
to open per-directory .gitattributes with error status other than
ENOENT and ENOTDIR should be diagnosed.
* jk/config-warn-on-inaccessible-paths:
attr: failure to open a .gitattributes file is OK with ENOTDIR
warn_on_inaccessible(): a helper to warn on inaccessible paths
attr: warn on inaccessible attribute files
gitignore: report access errors of exclude files
config: warn on inaccessible files
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 && errno != ENOTDIR) + warn_on_inaccessible(path); return NULL; + } res = xcalloc(1, sizeof(*res)); while (fgets(buf, sizeof(buf), fp)) handle_attr_line(res, buf, path, ++lineno, macro_ok); |