summaryrefslogtreecommitdiff
path: root/tests/config/include.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2017-03-23 12:03:29 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2017-03-23 12:12:39 +0000
commited812ee725dc73536e5a963655ccdd8be8dec028 (patch)
tree2c562a77ef4702b0c3fba651a94323b670c204f3 /tests/config/include.c
parent29aef94830edb6231a0737cfca35233f9a95463f (diff)
downloadlibgit2-ed812ee725dc73536e5a963655ccdd8be8dec028.tar.gz
config::include: sanitize homedir
Sanitize the home directory to ensure that we do not accidentally locate a file called `~/.nonexistentfile`.
Diffstat (limited to 'tests/config/include.c')
-rw-r--r--tests/config/include.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/config/include.c b/tests/config/include.c
index e46978b44..0a07c9b85 100644
--- a/tests/config/include.c
+++ b/tests/config/include.c
@@ -113,6 +113,7 @@ void test_config_include__missing_homedir(void)
git_config *cfg;
git_buf buf = GIT_BUF_INIT;
+ cl_git_pass(git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, cl_fixture("config")));
cl_git_mkfile("including", "[include]\npath = ~/.nonexistentfile\n[foo]\nbar = baz");
giterr_clear();
@@ -123,6 +124,8 @@ void test_config_include__missing_homedir(void)
git_buf_free(&buf);
git_config_free(cfg);
+
+ cl_sandbox_set_search_path_defaults();
}
#define replicate10(s) s s s s s s s s s s