summaryrefslogtreecommitdiff
path: root/tests-clar/clar_libgit2.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-05-10 07:50:53 -0700
committerRussell Belfer <rb@github.com>2013-05-10 07:50:53 -0700
commit1f9e41ee865ac3a9c60d39c7db212478c04bf86d (patch)
treecde2007848e73be7c5f0504308f498075dcb6297 /tests-clar/clar_libgit2.c
parent9ca4ff41eb4fae26b9336d440953bc6be752f832 (diff)
downloadlibgit2-1f9e41ee865ac3a9c60d39c7db212478c04bf86d.tar.gz
Improve ignore handling in git_status_file
The git_status_file API was doing a hack to deal with files that are inside ignored directories. The status scan was not reporting any file in this case, so git_status_file would attempt a final "stat()" call, and return IGNORED if the file actually existed. On case-insensitive filesystems where core.ignorecase is set incorrectly, this magic check can "succeed" and report a file as ignored when it should actually return ENOTFOUND. Now that we have the GIT_STATUS_OPT_RECURSE_IGNORED_DIRS, we can use that flag to make sure that git_status_file() will look into ignored directories and eliminate the hack completely, so we give the correct error.
Diffstat (limited to 'tests-clar/clar_libgit2.c')
-rw-r--r--tests-clar/clar_libgit2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests-clar/clar_libgit2.c b/tests-clar/clar_libgit2.c
index 68d17162b..de0e41bf7 100644
--- a/tests-clar/clar_libgit2.c
+++ b/tests-clar/clar_libgit2.c
@@ -190,6 +190,18 @@ git_repository *cl_git_sandbox_init(const char *sandbox)
return _cl_repo;
}
+git_repository *cl_git_sandbox_reopen(void)
+{
+ if (_cl_repo) {
+ git_repository_free(_cl_repo);
+ _cl_repo = NULL;
+
+ cl_git_pass(git_repository_open(&_cl_repo, _cl_sandbox));
+ }
+
+ return _cl_repo;
+}
+
void cl_git_sandbox_cleanup(void)
{
if (_cl_repo) {