diff options
| author | Paul Betts <paul@paulbetts.org> | 2011-09-19 10:38:44 -0700 |
|---|---|---|
| committer | Paul Betts <paul@paulbetts.org> | 2011-09-19 10:38:44 -0700 |
| commit | c498701df7700695e287ea0e2f08062f9147b3a6 (patch) | |
| tree | 0945b15ffe65867037b50443b155c5cf276b5bd1 /tests/t15-config.c | |
| parent | 222d057c2228b7b19d198c3e36d036f3186b5b90 (diff) | |
| download | libgit2-c498701df7700695e287ea0e2f08062f9147b3a6.tar.gz | |
Fix tests to use portable setenv
Diffstat (limited to 'tests/t15-config.c')
| -rw-r--r-- | tests/t15-config.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/t15-config.c b/tests/t15-config.c index fdfa092ef..d912abb8e 100644 --- a/tests/t15-config.c +++ b/tests/t15-config.c @@ -26,6 +26,7 @@ #include "test_helpers.h" #include <git2.h> +#include <posix.h> #include "filebuf.h" #define CONFIG_BASE TEST_RESOURCES "/config" @@ -217,7 +218,7 @@ BEGIN_TEST(config10, "a repo's config overrides the global config") char *old_home; old_home = git__strdup(getenv("HOME")); - setenv("HOME", CONFIG_BASE, 1); + p_setenv("HOME", CONFIG_BASE, 1); must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); must_pass(git_repository_config(&cfg, repo, NULL)); @@ -226,7 +227,7 @@ BEGIN_TEST(config10, "a repo's config overrides the global config") git_config_free(cfg); git_repository_free(repo); - setenv("HOME", old_home, 1); + p_setenv("HOME", old_home, 1); free(old_home); END_TEST @@ -237,7 +238,7 @@ BEGIN_TEST(config11, "fall back to the global config") char *old_home; old_home = git__strdup(getenv("HOME")); - setenv("HOME", CONFIG_BASE, 1); + p_setenv("HOME", CONFIG_BASE, 1); must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); must_pass(git_repository_config(&cfg, repo, NULL)); @@ -246,7 +247,7 @@ BEGIN_TEST(config11, "fall back to the global config") git_config_free(cfg); git_repository_free(repo); - setenv("HOME", old_home, 1); + p_setenv("HOME", old_home, 1); free(old_home); END_TEST |
