diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/t15-config.c | 4 | ||||
-rw-r--r-- | tests/t16-remotes.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/t15-config.c b/tests/t15-config.c index b959cc95a..ac2d79cfd 100644 --- a/tests/t15-config.c +++ b/tests/t15-config.c @@ -235,7 +235,7 @@ BEGIN_TEST(config10, "a repo's config overrides the global config") int version; char *old_home; - old_home = p_getenv("HOME"); + old_home = git__strdup(getenv("HOME")); p_setenv("HOME", CONFIG_BASE, 1); must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); @@ -255,7 +255,7 @@ BEGIN_TEST(config11, "fall back to the global config") int num; char *old_home; - old_home = p_getenv("HOME"); + old_home = git__strdup(getenv("HOME")); p_setenv("HOME", CONFIG_BASE, 1); must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); diff --git a/tests/t16-remotes.c b/tests/t16-remotes.c index b76557fb4..af54f297d 100644 --- a/tests/t16-remotes.c +++ b/tests/t16-remotes.c @@ -34,7 +34,7 @@ BEGIN_TEST(remotes0, "remote parsing works") git_config *cfg; char *old_home; - old_home = p_getenv("HOME"); + old_home = git__strdup(getenv("HOME")); p_setenv("HOME", "/dev/null", 1); must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); @@ -58,7 +58,7 @@ BEGIN_TEST(refspec0, "remote with refspec works") const git_refspec *refspec = NULL; char *old_home; - old_home = p_getenv("HOME"); + old_home = git__strdup(getenv("HOME")); p_setenv("HOME", "/dev/null", 1); must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); @@ -83,7 +83,7 @@ BEGIN_TEST(refspec1, "remote fnmatch works as expected") const git_refspec *refspec = NULL; char *old_home; - old_home = p_getenv("HOME"); + old_home = git__strdup(getenv("HOME")); p_setenv("HOME", "/dev/null", 1); must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); @@ -109,7 +109,7 @@ BEGIN_TEST(refspec2, "refspec transform") char ref[1024] = {0}; char *old_home; - old_home = p_getenv("HOME"); + old_home = git__strdup(getenv("HOME")); p_setenv("HOME", "/dev/null", 1); must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); |