mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 23:26:39 +00:00
Fix core::env cleanup code
Mark fake home directories that failed to be created, so we won't try to remove them and have cleanup just use p_rmdir.
This commit is contained in:
parent
54254a0fe2
commit
b8a1ea7cf9
@ -46,8 +46,12 @@ void test_core_env__cleanup(void)
|
|||||||
env_save[i] = NULL;
|
env_save[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* these will probably have already been cleaned up, but if a test
|
||||||
|
* fails, then it's probably good to try and clear out these dirs
|
||||||
|
*/
|
||||||
for (val = home_values; *val != NULL; val++) {
|
for (val = home_values; *val != NULL; val++) {
|
||||||
cl_fixture_cleanup(*val);
|
if (**val != '\0')
|
||||||
|
(void)p_rmdir(*val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,8 +83,10 @@ void test_core_env__0(void)
|
|||||||
* we are on a filesystem that doesn't support the
|
* we are on a filesystem that doesn't support the
|
||||||
* characters in question and skip this test...
|
* characters in question and skip this test...
|
||||||
*/
|
*/
|
||||||
if (p_mkdir(*val, 0777) != 0)
|
if (p_mkdir(*val, 0777) != 0) {
|
||||||
|
*val = ""; /* mark as not created */
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
cl_git_pass(git_path_prettify(&path, *val, NULL));
|
cl_git_pass(git_path_prettify(&path, *val, NULL));
|
||||||
|
|
||||||
@ -130,6 +136,8 @@ void test_core_env__0(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
(void)p_rmdir(*val);
|
||||||
}
|
}
|
||||||
|
|
||||||
git_buf_free(&path);
|
git_buf_free(&path);
|
||||||
|
Loading…
Reference in New Issue
Block a user