summaryrefslogtreecommitdiff
path: root/src/attr.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-08-21 17:26:39 -0700
committerRussell Belfer <rb@github.com>2012-08-21 17:26:39 -0700
commitf004c4a8a78ec1ac109b0a0c78cdebe47a5df215 (patch)
treef2732930c45178bb091c6e76e9b24472aed18d8a /src/attr.c
parentb2be351aaddc6ba0b3a0f2cf4e09536a3b27e598 (diff)
downloadlibgit2-f004c4a8a78ec1ac109b0a0c78cdebe47a5df215.tar.gz
Add public API for internal ignores
This creates a public API for adding to the internal ignores list, which already existing but was not accessible. This adds the new default value for core.excludesfile also.
Diffstat (limited to 'src/attr.c')
-rw-r--r--src/attr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/attr.c b/src/attr.c
index de714a697..8a7ff28c5 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -612,6 +612,16 @@ int git_attr_cache__init(git_repository *repo)
if (ret < 0 && ret != GIT_ENOTFOUND)
return ret;
+ if (ret == GIT_ENOTFOUND) {
+ git_buf dflt = GIT_BUF_INIT;
+
+ ret = git_futils_find_global_file(&dflt, GIT_IGNORE_CONFIG_DEFAULT);
+ if (!ret)
+ cache->cfg_excl_file = git_buf_detach(&dflt);
+
+ git_buf_free(&dflt);
+ }
+
giterr_clear();
/* allocate hashtable for attribute and ignore file contents */