summaryrefslogtreecommitdiff
path: root/tests/clar_libgit2.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-14 15:59:48 -0700
committerRussell Belfer <rb@github.com>2014-04-14 15:59:48 -0700
commita9528b8fdd627e11b9dee099a10fa7697380b3e7 (patch)
treee7a54e8f5694d6cb37223e480bdab7e5bb104a65 /tests/clar_libgit2.h
parent289e31cd24f80fa8ed77e40eeb9295964256cb6a (diff)
downloadlibgit2-a9528b8fdd627e11b9dee099a10fa7697380b3e7.tar.gz
Fix core.excludesfile named .gitignorerb/fix-leading-slash-ignores
Ignore rules with slashes in them are matched using FNM_PATHNAME and use the path to the .gitignore file from the root of the repository along with the path fragment (including slashes) in the ignore file itself. Unfortunately, the relative path to the .gitignore file was being applied to the global core.excludesfile if that was also named ".gitignore". This fixes that with more precise matching and includes test for ignore rules with leading slashes (which were the primary example of this being broken in the real world). This also backports an improvement to the file context logic from the threadsafe-iterators branch where we don't rely on mutating the key of the attribute file name to generate the context path.
Diffstat (limited to 'tests/clar_libgit2.h')
-rw-r--r--tests/clar_libgit2.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/clar_libgit2.h b/tests/clar_libgit2.h
index 3de80bfa0..c2489db38 100644
--- a/tests/clar_libgit2.h
+++ b/tests/clar_libgit2.h
@@ -120,4 +120,7 @@ int cl_repo_get_bool(git_repository *repo, const char *cfg);
void cl_repo_set_string(git_repository *repo, const char *cfg, const char *value);
+void cl_fake_home(git_buf *restore);
+void cl_fake_home_cleanup(git_buf *restore);
+
#endif