File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,15 @@ void test_core_rmdir__initialize(void)
3030/* make sure empty dir can be deleted recusively */
3131void test_core_rmdir__delete_recursive (void )
3232{
33+ git_buf path = GIT_BUF_INIT ;
34+ cl_git_pass (git_buf_joinpath (& path , empty_tmp_dir , "/one" ));
35+ cl_assert (git_path_exists (git_buf_cstr (& path )));
36+
3337 cl_git_pass (git_futils_rmdir_r (empty_tmp_dir , NULL , GIT_RMDIR_EMPTY_HIERARCHY ));
38+
39+ cl_assert (!git_path_exists (git_buf_cstr (& path )));
40+
41+ git_buf_dispose (& path );
3442}
3543
3644/* make sure non-empty dir cannot be deleted recusively */
@@ -47,9 +55,17 @@ void test_core_rmdir__fail_to_delete_non_empty_dir(void)
4755 cl_must_pass (p_unlink (file .ptr ));
4856 cl_git_pass (git_futils_rmdir_r (empty_tmp_dir , NULL , GIT_RMDIR_EMPTY_HIERARCHY ));
4957
58+ cl_assert (!git_path_exists (empty_tmp_dir ));
59+
5060 git_buf_dispose (& file );
5161}
5262
63+ void test_core_rmdir__keep_base (void )
64+ {
65+ cl_git_pass (git_futils_rmdir_r (empty_tmp_dir , NULL , GIT_RMDIR_SKIP_ROOT ));
66+ cl_assert (git_path_exists (empty_tmp_dir ));
67+ }
68+
5369void test_core_rmdir__can_skip_non_empty_dir (void )
5470{
5571 git_buf file = GIT_BUF_INIT ;
You can’t perform that action at this time.
0 commit comments