diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-05 06:38:22 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-11-05 06:38:22 -0800 |
commit | 264628a2b3a5cb6c7671ea87ceecab941ec290e9 (patch) | |
tree | 1ff25b95990273abc7d5b902baf4ae0c7cbe822a /attr.c | |
parent | 189627cd588c2937de7b655595b8ed777f445c85 (diff) | |
download | git-264628a2b3a5cb6c7671ea87ceecab941ec290e9.tar.gz git-264628a2b3a5cb6c7671ea87ceecab941ec290e9.tar.bz2 git-264628a2b3a5cb6c7671ea87ceecab941ec290e9.zip |
Imported Upstream version 1.8.0upstream/1.8.0
Diffstat (limited to 'attr.c')
-rw-r--r-- | attr.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -306,7 +306,7 @@ static void free_attr_elem(struct attr_stack *e) } static const char *builtin_attr[] = { - "[attr]binary -diff -text", + "[attr]binary -diff -merge -text", NULL, }; @@ -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); @@ -497,6 +500,7 @@ static int git_attr_system(void) static void bootstrap_attr_stack(void) { struct attr_stack *elem; + char *xdg_attributes_file; if (attr_stack) return; @@ -515,6 +519,10 @@ static void bootstrap_attr_stack(void) } } + if (!git_attributes_file) { + home_config_paths(NULL, &xdg_attributes_file, "attributes"); + git_attributes_file = xdg_attributes_file; + } if (git_attributes_file) { elem = read_attr_from_file(git_attributes_file, 1); if (elem) { |