mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 16:34:37 +00:00
tests: use out-of-the-way config dir in sandbox
Don't put the configuration in a subdir of the sandbox named `config`, lest some tests decide to create their own directory called `config`. Prefix with some underscores for uniqueness.
This commit is contained in:
parent
fe96374823
commit
88638f9b18
@ -541,16 +541,23 @@ void cl_fake_home(void)
|
||||
|
||||
void cl_sandbox_set_search_path_defaults(void)
|
||||
{
|
||||
const char *sandbox_path = clar_sandbox_path();
|
||||
git_buf path = GIT_BUF_INIT;
|
||||
|
||||
git_buf_joinpath(&path, clar_sandbox_path(), "__config");
|
||||
|
||||
if (!git_path_exists(path.ptr))
|
||||
cl_must_pass(p_mkdir(path.ptr, 0777));
|
||||
|
||||
git_libgit2_opts(
|
||||
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, sandbox_path);
|
||||
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, path.ptr);
|
||||
git_libgit2_opts(
|
||||
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_XDG, sandbox_path);
|
||||
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_XDG, path.ptr);
|
||||
git_libgit2_opts(
|
||||
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_SYSTEM, sandbox_path);
|
||||
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_SYSTEM, path.ptr);
|
||||
git_libgit2_opts(
|
||||
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_PROGRAMDATA, sandbox_path);
|
||||
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_PROGRAMDATA, path.ptr);
|
||||
|
||||
git_buf_free(&path);
|
||||
}
|
||||
|
||||
#ifdef GIT_WIN32
|
||||
|
Loading…
Reference in New Issue
Block a user