Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-05-02 01:47:33 +0400
committerRussell Belfer <rb@github.com>2014-05-02 20:21:33 +0400
commit0f603132bc2397bf8308e72651c56cb7dbd3ad70 (patch)
tree0ea052ae8023fc0929e8af5e08422bd336b946e1 /tests/attr
parentbc91347b5894c98964a12c6637d5ca91d9723b42 (diff)
Improve handling of fake home directory
There are a few tests that set up a fake home directory and a fake GLOBAL search path so that we can test things in global ignore or attribute or config files. This cleans up that code to work more robustly even if there is a test failure. This also fixes some valgrind warnings where scanning search paths for separators could end up doing a little bit of sketchy data access when coming to the end of search list.
Diffstat (limited to 'tests/attr')
-rw-r--r--tests/attr/ignore.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/attr/ignore.c b/tests/attr/ignore.c
index 5eadc7b3e..b187db01c 100644
--- a/tests/attr/ignore.c
+++ b/tests/attr/ignore.c
@@ -148,12 +148,11 @@ void test_attr_ignore__skip_gitignore_directory(void)
void test_attr_ignore__expand_tilde_to_homedir(void)
{
- git_buf cleanup = GIT_BUF_INIT;
git_config *cfg;
assert_is_ignored(false, "example.global_with_tilde");
- cl_fake_home(&cleanup);
+ cl_fake_home();
/* construct fake home with fake global excludes */
cl_git_mkfile("home/globalexclude", "# found me\n*.global_with_tilde\n");
@@ -168,7 +167,7 @@ void test_attr_ignore__expand_tilde_to_homedir(void)
cl_git_pass(git_futils_rmdir_r("home", NULL, GIT_RMDIR_REMOVE_FILES));
- cl_fake_home_cleanup(&cleanup);
+ cl_fake_home_cleanup(NULL);
git_attr_cache_flush(g_repo); /* must reset to pick up change */