diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2011-07-03 22:27:05 +0200 |
|---|---|---|
| committer | schu <schu-github@schulog.org> | 2011-07-06 12:25:27 +0200 |
| commit | 1b938a58267f0a11240f0e7da7233607c6b78a2d (patch) | |
| tree | 1d4188ac05bfb16bbee7945a593a428fdc4cb743 /tests/test_helpers.c | |
| parent | 1ee5fd903d00930aab08edecc6b409a34761cf7e (diff) | |
| download | libgit2-1b938a58267f0a11240f0e7da7233607c6b78a2d.tar.gz | |
Remove duplicated recursive directory removal related code
Diffstat (limited to 'tests/test_helpers.c')
| -rw-r--r-- | tests/test_helpers.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/tests/test_helpers.c b/tests/test_helpers.c index 5c2ccee15..f2f37a1e4 100644 --- a/tests/test_helpers.c +++ b/tests/test_helpers.c @@ -176,34 +176,6 @@ int cmp_files(const char *a, const char *b) return error; } -static int remove_filesystem_element_recurs(void *GIT_UNUSED(nil), char *path) -{ - int error = GIT_SUCCESS; - - GIT_UNUSED_ARG(nil); - - error = git_futils_isdir(path); - if (error == GIT_SUCCESS) { - size_t root_size = strlen(path); - - error = git_futils_direach(path, GIT_PATH_MAX, remove_filesystem_element_recurs, NULL); - if (error < GIT_SUCCESS) - return error; - - path[root_size] = 0; - return rmdir(path); - } - - return p_unlink(path); -} - -int rmdir_recurs(const char *directory_path) -{ - char buffer[GIT_PATH_MAX]; - strcpy(buffer, directory_path); - return remove_filesystem_element_recurs(NULL, buffer); -} - typedef struct { size_t src_len, dst_len; char *dst; @@ -255,7 +227,7 @@ int open_temp_repo(git_repository **repo, const char *path) void close_temp_repo(git_repository *repo) { git_repository_free(repo); - rmdir_recurs(TEMP_REPO_FOLDER); + git_futils_rmdir_recurs(TEMP_REPO_FOLDER, 1); } static int remove_placeholders_recurs(void *filename, char *path) |
