Merge branch 'jk/config-warn-on-inaccessible-paths'
authorJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2012 22:55:41 +0000 (15:55 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2012 22:55:41 +0000 (15:55 -0700)
The attribute system may be asked for a path that itself or its
leading directories no longer exists in the working tree. Failure
to open per-directory .gitattributes with error status other than
ENOENT and ENOTDIR are diagnosed.

* jk/config-warn-on-inaccessible-paths:
attr: failure to open a .gitattributes file is OK with ENOTDIR

attr.c
diff --git a/attr.c b/attr.c
index 3430faf2ccc5e11a9c04432b7a4f13160130e141..887a9ae46b7044489845abf2072339271caf2d4a 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -353,7 +353,7 @@ static struct attr_stack *read_attr_from_file(const char *path, int macro_ok)
        int lineno = 0;
 
        if (!fp) {
-               if (errno != ENOENT)
+               if (errno != ENOENT && errno != ENOTDIR)
                        warn_on_inaccessible(path);
                return NULL;
        }