test: set a temporary PROGRAMDATA directory

Like we set temporary system and global configuration directories, we
need to set a programdata directory for safe test handling.
This commit is contained in:
Edward Thomson
2025-01-20 22:32:23 +00:00
parent 90465353a5
commit 21af9ec86c

View File

@@ -20,6 +20,11 @@ void test_config_global__initialize(void)
cl_git_pass(git_libgit2_opts(
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_SYSTEM, path.ptr));
cl_git_pass(git_futils_mkdir_r("programdata", 0777));
cl_git_pass(git_fs_path_prettify(&path, "programdata", NULL));
cl_git_pass(git_libgit2_opts(
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_PROGRAMDATA, path.ptr));
git_str_dispose(&path);
}