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/status
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/status')
-rw-r--r--tests/status/ignore.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index d88b2eb6b..caa1f1927 100644
--- a/tests/status/ignore.c
+++ b/tests/status/ignore.c
@@ -364,7 +364,6 @@ void test_status_ignore__leading_slash_ignores(void)
{
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
status_entry_counts counts;
- git_buf home = GIT_BUF_INIT;
static const char *paths_2[] = {
"dir/.gitignore",
"dir/a/ignore_me",
@@ -385,7 +384,7 @@ void test_status_ignore__leading_slash_ignores(void)
make_test_data(test_repo_1, test_files_1);
- cl_fake_home(&home);
+ cl_fake_home();
cl_git_mkfile("home/.gitignore", "/ignore_me\n");
{
git_config *cfg;
@@ -412,8 +411,6 @@ void test_status_ignore__leading_slash_ignores(void)
cl_assert_equal_i(counts.expected_entry_count, counts.entry_count);
cl_assert_equal_i(0, counts.wrong_status_flags_count);
cl_assert_equal_i(0, counts.wrong_sorted_path);
-
- cl_fake_home_cleanup(&home);
}
void test_status_ignore__contained_dir_with_matching_name(void)