summaryrefslogtreecommitdiff
path: root/tests-clar
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-10-05 15:56:57 -0700
committerRussell Belfer <rb@github.com>2012-10-09 11:59:34 -0700
commit0d64bef941928046d114c4da1acb70bd2907855e (patch)
tree4ae0ac6484c62b0a63ca44f937d67ba15f97d7f0 /tests-clar
parentf3a04e0f49d0f46e578613d1c27161abc4c2bf22 (diff)
downloadlibgit2-0d64bef941928046d114c4da1acb70bd2907855e.tar.gz
Add complex checkout test and then fix checkout
This started as a complex new test for checkout going through the "typechanges" test repository, but that revealed numerous issues with checkout, including: * complete failure with submodules * failure to create blobs with exec bits * problems when replacing a tree with a blob because the tree "example/" sorts after the blob "example" so the delete was being processed after the single file blob was created This fixes most of those problems and includes a number of other minor changes that made it easier to do that, including improving the TYPECHANGE support in diff/status, etc.
Diffstat (limited to 'tests-clar')
-rw-r--r--tests-clar/checkout/typechange.c72
-rw-r--r--tests-clar/core/copy.c8
-rw-r--r--tests-clar/core/mkdir.c14
-rw-r--r--tests-clar/core/rmdir.c10
-rw-r--r--tests-clar/diff/iterator.c98
-rw-r--r--tests-clar/object/blob/write.c4
-rw-r--r--tests-clar/repo/discover.c2
-rw-r--r--tests-clar/repo/open.c6
-rw-r--r--tests-clar/resources/typechanges/.gitted/indexbin184 -> 184 bytes
-rw-r--r--tests-clar/resources/typechanges/README.md55
-rw-r--r--tests-clar/status/worktree.c6
-rw-r--r--tests-clar/submodule/status.c8
12 files changed, 232 insertions, 51 deletions
diff --git a/tests-clar/checkout/typechange.c b/tests-clar/checkout/typechange.c
new file mode 100644
index 000000000..f013617d5
--- /dev/null
+++ b/tests-clar/checkout/typechange.c
@@ -0,0 +1,72 @@
+#include "clar_libgit2.h"
+#include "git2/checkout.h"
+#include "path.h"
+#include "posix.h"
+
+static git_repository *g_repo = NULL;
+
+static const char *g_typechange_oids[] = {
+ "79b9f23e85f55ea36a472a902e875bc1121a94cb",
+ "9bdb75b73836a99e3dbeea640a81de81031fdc29",
+ "0e7ed140b514b8cae23254cb8656fe1674403aff",
+ "9d0235c7a7edc0889a18f97a42ee6db9fe688447",
+ "9b19edf33a03a0c59cdfc113bfa5c06179bf9b1a",
+ "1b63caae4a5ca96f78e8dfefc376c6a39a142475",
+ "6eae26c90e8ccc4d16208972119c40635489c6f0",
+ NULL
+};
+
+static bool g_typechange_empty[] = {
+ true, false, false, false, false, false, true, true
+};
+
+void test_checkout_typechange__initialize(void)
+{
+ g_repo = cl_git_sandbox_init("typechanges");
+
+ cl_fixture_sandbox("submod2_target");
+ p_rename("submod2_target/.gitted", "submod2_target/.git");
+}
+
+void test_checkout_typechange__cleanup(void)
+{
+ cl_git_sandbox_cleanup();
+ cl_fixture_cleanup("submod2_target");
+}
+
+void test_checkout_typechange__checkout_typechanges(void)
+{
+ int i;
+ git_object *obj;
+ git_checkout_opts opts = {0};
+
+ opts.checkout_strategy =
+ GIT_CHECKOUT_REMOVE_UNTRACKED |
+ GIT_CHECKOUT_CREATE_MISSING |
+ GIT_CHECKOUT_OVERWRITE_MODIFIED;
+
+ for (i = 0; g_typechange_oids[i] != NULL; ++i) {
+ cl_git_pass(git_revparse_single(&obj, g_repo, g_typechange_oids[i]));
+ /* fprintf(stderr, "checking out '%s'\n", g_typechange_oids[i]); */
+
+ cl_git_pass(git_checkout_tree(g_repo, obj, &opts, NULL));
+
+ git_object_free(obj);
+
+ if (!g_typechange_empty[i]) {
+ cl_assert(git_path_isdir("typechanges"));
+ cl_assert(git_path_exists("typechanges/a"));
+ cl_assert(git_path_exists("typechanges/b"));
+ cl_assert(git_path_exists("typechanges/c"));
+ cl_assert(git_path_exists("typechanges/d"));
+ cl_assert(git_path_exists("typechanges/e"));
+ } else {
+ cl_assert(git_path_isdir("typechanges"));
+ cl_assert(!git_path_exists("typechanges/a"));
+ cl_assert(!git_path_exists("typechanges/b"));
+ cl_assert(!git_path_exists("typechanges/c"));
+ cl_assert(!git_path_exists("typechanges/d"));
+ cl_assert(!git_path_exists("typechanges/e"));
+ }
+ }
+}
diff --git a/tests-clar/core/copy.c b/tests-clar/core/copy.c
index 2fdfed863..d0b21f6ec 100644
--- a/tests-clar/core/copy.c
+++ b/tests-clar/core/copy.c
@@ -41,7 +41,7 @@ void test_core_copy__file_in_dir(void)
cl_assert(S_ISREG(st.st_mode));
cl_assert(strlen(content) == (size_t)st.st_size);
- cl_git_pass(git_futils_rmdir_r("an_dir", GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r("an_dir", NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_assert(!git_path_isdir("an_dir"));
}
@@ -95,7 +95,7 @@ void test_core_copy__tree(void)
cl_assert(S_ISLNK(st.st_mode));
#endif
- cl_git_pass(git_futils_rmdir_r("t1", GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r("t1", NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_assert(!git_path_isdir("t1"));
/* copy with empty dirs, no links, yes dotfiles, no overwrite */
@@ -119,8 +119,8 @@ void test_core_copy__tree(void)
cl_git_fail(git_path_lstat("t2/c/d/l1", &st));
#endif
- cl_git_pass(git_futils_rmdir_r("t2", GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r("t2", NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_assert(!git_path_isdir("t2"));
- cl_git_pass(git_futils_rmdir_r("src", GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r("src", NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
}
diff --git a/tests-clar/core/mkdir.c b/tests-clar/core/mkdir.c
index 08ba2419e..e5dc6654b 100644
--- a/tests-clar/core/mkdir.c
+++ b/tests-clar/core/mkdir.c
@@ -6,11 +6,11 @@
static void cleanup_basic_dirs(void *ref)
{
GIT_UNUSED(ref);
- git_futils_rmdir_r("d0", GIT_DIRREMOVAL_EMPTY_HIERARCHY);
- git_futils_rmdir_r("d1", GIT_DIRREMOVAL_EMPTY_HIERARCHY);
- git_futils_rmdir_r("d2", GIT_DIRREMOVAL_EMPTY_HIERARCHY);
- git_futils_rmdir_r("d3", GIT_DIRREMOVAL_EMPTY_HIERARCHY);
- git_futils_rmdir_r("d4", GIT_DIRREMOVAL_EMPTY_HIERARCHY);
+ git_futils_rmdir_r("d0", NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY);
+ git_futils_rmdir_r("d1", NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY);
+ git_futils_rmdir_r("d2", NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY);
+ git_futils_rmdir_r("d3", NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY);
+ git_futils_rmdir_r("d4", NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY);
}
void test_core_mkdir__basic(void)
@@ -56,7 +56,7 @@ void test_core_mkdir__basic(void)
static void cleanup_basedir(void *ref)
{
GIT_UNUSED(ref);
- git_futils_rmdir_r("base", GIT_DIRREMOVAL_EMPTY_HIERARCHY);
+ git_futils_rmdir_r("base", NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY);
}
void test_core_mkdir__with_base(void)
@@ -108,7 +108,7 @@ static void cleanup_chmod_root(void *ref)
git__free(mode);
}
- git_futils_rmdir_r("r", GIT_DIRREMOVAL_EMPTY_HIERARCHY);
+ git_futils_rmdir_r("r", NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY);
}
static void check_mode(mode_t expected, mode_t actual)
diff --git a/tests-clar/core/rmdir.c b/tests-clar/core/rmdir.c
index 530f1f908..9ada8f426 100644
--- a/tests-clar/core/rmdir.c
+++ b/tests-clar/core/rmdir.c
@@ -30,7 +30,7 @@ void test_core_rmdir__initialize(void)
/* make sure empty dir can be deleted recusively */
void test_core_rmdir__delete_recursive(void)
{
- cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, GIT_DIRREMOVAL_EMPTY_HIERARCHY));
+ cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY));
}
/* make sure non-empty dir cannot be deleted recusively */
@@ -42,10 +42,10 @@ void test_core_rmdir__fail_to_delete_non_empty_dir(void)
cl_git_mkfile(git_buf_cstr(&file), "dummy");
- cl_git_fail(git_futils_rmdir_r(empty_tmp_dir, GIT_DIRREMOVAL_EMPTY_HIERARCHY));
+ cl_git_fail(git_futils_rmdir_r(empty_tmp_dir, NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY));
cl_must_pass(p_unlink(file.ptr));
- cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, GIT_DIRREMOVAL_EMPTY_HIERARCHY));
+ cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, NULL, GIT_DIRREMOVAL_EMPTY_HIERARCHY));
git_buf_free(&file);
}
@@ -58,10 +58,10 @@ void test_core_rmdir__can_skip__non_empty_dir(void)
cl_git_mkfile(git_buf_cstr(&file), "dummy");
- cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, GIT_DIRREMOVAL_ONLY_EMPTY_DIRS));
+ cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, NULL, GIT_DIRREMOVAL_ONLY_EMPTY_DIRS));
cl_assert(git_path_exists(git_buf_cstr(&file)) == true);
- cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_assert(git_path_exists(empty_tmp_dir) == false);
git_buf_free(&file);
diff --git a/tests-clar/diff/iterator.c b/tests-clar/diff/iterator.c
index c27d3fa6c..023bc465a 100644
--- a/tests-clar/diff/iterator.c
+++ b/tests-clar/diff/iterator.c
@@ -1,6 +1,7 @@
#include "clar_libgit2.h"
#include "diff_helpers.h"
#include "iterator.h"
+#include "tree.h"
void test_diff_iterator__initialize(void)
{
@@ -237,6 +238,103 @@ void test_diff_iterator__tree_range_empty_2(void)
NULL, ".aaa_empty_before", 0, NULL);
}
+static void check_tree_entry(
+ git_iterator *i,
+ const char *oid,
+ const char *oid_p,
+ const char *oid_pp,
+ const char *oid_ppp)
+{
+ const git_index_entry *ie;
+ const git_tree_entry *te;
+ const git_tree *tree;
+ git_buf path = GIT_BUF_INIT;
+
+ cl_git_pass(git_iterator_current_tree_entry(i, &te));
+ cl_assert(te);
+ cl_assert(git_oid_streq(&te->oid, oid) == 0);
+
+ cl_git_pass(git_iterator_current(i, &ie));
+ cl_git_pass(git_buf_sets(&path, ie->path));
+
+ if (oid_p) {
+ git_buf_rtruncate_at_char(&path, '/');
+ cl_git_pass(git_iterator_current_parent_tree(i, path.ptr, &tree));
+ cl_assert(tree);
+ cl_assert(git_oid_streq(git_tree_id(tree), oid_p) == 0);
+ }
+
+ if (oid_pp) {
+ git_buf_rtruncate_at_char(&path, '/');
+ cl_git_pass(git_iterator_current_parent_tree(i, path.ptr, &tree));
+ cl_assert(tree);
+ cl_assert(git_oid_streq(git_tree_id(tree), oid_pp) == 0);
+ }
+
+ if (oid_ppp) {
+ git_buf_rtruncate_at_char(&path, '/');
+ cl_git_pass(git_iterator_current_parent_tree(i, path.ptr, &tree));
+ cl_assert(tree);
+ cl_assert(git_oid_streq(git_tree_id(tree), oid_ppp) == 0);
+ }
+
+ git_buf_free(&path);
+}
+
+void test_diff_iterator__tree_special_functions(void)
+{
+ git_tree *t;
+ git_iterator *i;
+ const git_index_entry *entry;
+ git_repository *repo = cl_git_sandbox_init("attr");
+ int cases = 0;
+ const char *rootoid = "ce39a97a7fb1fa90bcf5e711249c1e507476ae0e";
+
+ t = resolve_commit_oid_to_tree(
+ repo, "24fa9a9fc4e202313e24b648087495441dab432b");
+ cl_assert(t != NULL);
+
+ cl_git_pass(git_iterator_for_tree_range(&i, repo, t, NULL, NULL));
+ cl_git_pass(git_iterator_current(i, &entry));
+
+ while (entry != NULL) {
+ if (strcmp(entry->path, "sub/file") == 0) {
+ cases++;
+ check_tree_entry(
+ i, "45b983be36b73c0788dc9cbcb76cbb80fc7bb057",
+ "ecb97df2a174987475ac816e3847fc8e9f6c596b",
+ rootoid, NULL);
+ }
+ else if (strcmp(entry->path, "sub/sub/subsub.txt") == 0) {
+ cases++;
+ check_tree_entry(
+ i, "9e5bdc47d6a80f2be0ea3049ad74231b94609242",
+ "4e49ba8c5b6c32ff28cd9dcb60be34df50fcc485",
+ "ecb97df2a174987475ac816e3847fc8e9f6c596b", rootoid);
+ }
+ else if (strcmp(entry->path, "subdir/.gitattributes") == 0) {
+ cases++;
+ check_tree_entry(
+ i, "99eae476896f4907224978b88e5ecaa6c5bb67a9",
+ "9fb40b6675dde60b5697afceae91b66d908c02d9",
+ rootoid, NULL);
+ }
+ else if (strcmp(entry->path, "subdir2/subdir2_test1") == 0) {
+ cases++;
+ check_tree_entry(
+ i, "dccada462d3df8ac6de596fb8c896aba9344f941",
+ "2929de282ce999e95183aedac6451d3384559c4b",
+ rootoid, NULL);
+ }
+
+ cl_git_pass(git_iterator_advance(i, &entry));
+ }
+
+ cl_assert_equal_i(4, cases);
+ git_iterator_free(i);
+ git_tree_free(t);
+}
+
/* -- INDEX ITERATOR TESTS -- */
static void index_iterator_test(
diff --git a/tests-clar/object/blob/write.c b/tests-clar/object/blob/write.c
index 722c7b956..87a9e2072 100644
--- a/tests-clar/object/blob/write.c
+++ b/tests-clar/object/blob/write.c
@@ -49,7 +49,7 @@ void test_object_blob_write__can_create_a_blob_in_a_standard_repo_from_a_absolut
assert_blob_creation(ELSEWHERE "/test.txt", git_buf_cstr(&full_path), &git_blob_create_fromdisk);
git_buf_free(&full_path);
- cl_must_pass(git_futils_rmdir_r(ELSEWHERE, GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_must_pass(git_futils_rmdir_r(ELSEWHERE, NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
}
void test_object_blob_write__can_create_a_blob_in_a_bare_repo_from_a_absolute_filepath(void)
@@ -65,5 +65,5 @@ void test_object_blob_write__can_create_a_blob_in_a_bare_repo_from_a_absolute_fi
assert_blob_creation(ELSEWHERE "/test.txt", git_buf_cstr(&full_path), &git_blob_create_fromdisk);
git_buf_free(&full_path);
- cl_must_pass(git_futils_rmdir_r(ELSEWHERE, GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_must_pass(git_futils_rmdir_r(ELSEWHERE, NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
}
diff --git a/tests-clar/repo/discover.c b/tests-clar/repo/discover.c
index b3d639bd1..b5afab75a 100644
--- a/tests-clar/repo/discover.c
+++ b/tests-clar/repo/discover.c
@@ -135,7 +135,7 @@ void test_repo_discover__0(void)
ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB, ceiling_dirs, sub_repository_path);
ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB, ceiling_dirs, repository_path);
- cl_git_pass(git_futils_rmdir_r(TEMP_REPO_FOLDER, GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r(TEMP_REPO_FOLDER, NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
git_repository_free(repo);
git_buf_free(&ceiling_dirs_buf);
}
diff --git a/tests-clar/repo/open.c b/tests-clar/repo/open.c
index c70ec83a9..ef912fa0e 100644
--- a/tests-clar/repo/open.c
+++ b/tests-clar/repo/open.c
@@ -7,7 +7,7 @@ void test_repo_open__cleanup(void)
cl_git_sandbox_cleanup();
if (git_path_isdir("alternate"))
- git_futils_rmdir_r("alternate", GIT_DIRREMOVAL_FILES_AND_DIRS);
+ git_futils_rmdir_r("alternate", NULL, GIT_DIRREMOVAL_FILES_AND_DIRS);
}
void test_repo_open__bare_empty_repo(void)
@@ -202,8 +202,8 @@ void test_repo_open__bad_gitlinks(void)
cl_git_fail(git_repository_open_ext(&repo, "alternate", 0, NULL));
}
- git_futils_rmdir_r("invalid", GIT_DIRREMOVAL_FILES_AND_DIRS);
- git_futils_rmdir_r("invalid2", GIT_DIRREMOVAL_FILES_AND_DIRS);
+ git_futils_rmdir_r("invalid", NULL, GIT_DIRREMOVAL_FILES_AND_DIRS);
+ git_futils_rmdir_r("invalid2", NULL, GIT_DIRREMOVAL_FILES_AND_DIRS);
}
#ifdef GIT_WIN32
diff --git a/tests-clar/resources/typechanges/.gitted/index b/tests-clar/resources/typechanges/.gitted/index
index 2f4c6d752..4f6d12a3b 100644
--- a/tests-clar/resources/typechanges/.gitted/index
+++ b/tests-clar/resources/typechanges/.gitted/index
Binary files differ
diff --git a/tests-clar/resources/typechanges/README.md b/tests-clar/resources/typechanges/README.md
index 99e8bab9e..1f5a95a9f 100644
--- a/tests-clar/resources/typechanges/README.md
+++ b/tests-clar/resources/typechanges/README.md
@@ -1,32 +1,43 @@
This is a test repo for libgit2 where tree entries have type changes
+Types
+-----
+
The key types that could be found in tree entries are:
-1 - GIT_FILEMODE_NEW = 0000000
-2 - GIT_FILEMODE_TREE = 0040000
-3 - GIT_FILEMODE_BLOB = 0100644
-4 - GIT_FILEMODE_BLOB_EXECUTABLE = 0100755
-5 - GIT_FILEMODE_LINK = 0120000
-6 - GIT_FILEMODE_COMMIT = 0160000
+1. GIT_FILEMODE_NEW = 0000000 (i.e. file does not exist)
+2. GIT_FILEMODE_TREE = 0040000
+3. GIT_FILEMODE_BLOB = 0100644
+4. GIT_FILEMODE_BLOB_EXECUTABLE = 0100755
+5. GIT_FILEMODE_LINK = 0120000
+6. GIT_FILEMODE_COMMIT = 0160000
I will try to have every type of transition somewhere in the history
of this repo.
Commits
-------
-Initial commit - a(1) b(1) c(1) d(1) e(1)
- 79b9f23e85f55ea36a472a902e875bc1121a94cb
-Create content - a(1->2) b(1->3) c(1->4) d(1->5) e(1->6)
- 9bdb75b73836a99e3dbeea640a81de81031fdc29
-Changes #1 - a(2->3) b(3->4) c(4->5) d(5->6) e(6->2)
- 0e7ed140b514b8cae23254cb8656fe1674403aff
-Changes #2 - a(3->5) b(4->6) c(5->2) d(6->3) e(2->4)
- 9d0235c7a7edc0889a18f97a42ee6db9fe688447
-Changes #3 - a(5->3) b(6->4) c(2->5) d(3->6) e(4->2)
- 9b19edf33a03a0c59cdfc113bfa5c06179bf9b1a
-Changes #4 - a(3->2) b(4->3) c(5->4) d(6->5) e(2->6)
- 1b63caae4a5ca96f78e8dfefc376c6a39a142475
- Matches "Changes #1" except README.md
-Changes #5 - a(2->1) b(3->1) c(4->1) d(5->1) e(6->1)
- 6eae26c90e8ccc4d16208972119c40635489c6f0
- Matches "Initial commit" except README.md and .gitmodules
+
+* `a(1--1) b(1--1) c(1--1) d(1--1) e(1--1)`
+ **Initial commit**<br>
+ `79b9f23e85f55ea36a472a902e875bc1121a94cb`
+* `a(1->2) b(1->3) c(1->4) d(1->5) e(1->6)`
+ **Create content**<br>
+ `9bdb75b73836a99e3dbeea640a81de81031fdc29`
+* `a(2->3) b(3->4) c(4->5) d(5->6) e(6->2)`
+ **Changes #1**<br>
+ `0e7ed140b514b8cae23254cb8656fe1674403aff`
+* `a(3->5) b(4->6) c(5->2) d(6->3) e(2->4)`
+ **Changes #2**<br>
+ `9d0235c7a7edc0889a18f97a42ee6db9fe688447`
+* `a(5->3) b(6->4) c(2->5) d(3->6) e(4->2)`
+ **Changes #3**<br>
+ `9b19edf33a03a0c59cdfc113bfa5c06179bf9b1a`
+* `a(3->2) b(4->3) c(5->4) d(6->5) e(2->6)`
+ **Changes #4**<br>
+ `1b63caae4a5ca96f78e8dfefc376c6a39a142475`<br>
+ Matches **Changes #1** except README.md
+* `a(2->1) b(3->1) c(4->1) d(5->1) e(6->1)`
+ **Changes #5**<br>
+ `6eae26c90e8ccc4d16208972119c40635489c6f0`<br>
+ Matches **Initial commit** except README.md and .gitmodules
diff --git a/tests-clar/status/worktree.c b/tests-clar/status/worktree.c
index 0ceba7f16..4f03643c0 100644
--- a/tests-clar/status/worktree.c
+++ b/tests-clar/status/worktree.c
@@ -71,7 +71,7 @@ static int remove_file_cb(void *data, git_buf *file)
return 0;
if (git_path_isdir(filename))
- cl_git_pass(git_futils_rmdir_r(filename, GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r(filename, NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
else
cl_git_pass(p_unlink(git_buf_cstr(file)));
@@ -314,7 +314,7 @@ void test_status_worktree__issue_592_3(void)
repo = cl_git_sandbox_init("issue_592");
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(repo), "c"));
- cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_git_pass(git_status_foreach(repo, cb_status__check_592, "c/a.txt"));
@@ -344,7 +344,7 @@ void test_status_worktree__issue_592_5(void)
repo = cl_git_sandbox_init("issue_592");
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(repo), "t"));
- cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_git_pass(p_mkdir(git_buf_cstr(&path), 0777));
cl_git_pass(git_status_foreach(repo, cb_status__check_592, NULL));
diff --git a/tests-clar/submodule/status.c b/tests-clar/submodule/status.c
index d3a39235a..63073ceca 100644
--- a/tests-clar/submodule/status.c
+++ b/tests-clar/submodule/status.c
@@ -50,7 +50,7 @@ void test_submodule_status__ignore_none(void)
git_buf path = GIT_BUF_INIT;
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "sm_unchanged"));
- cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_git_fail(git_submodule_lookup(&sm, g_repo, "not_submodule"));
@@ -135,7 +135,7 @@ void test_submodule_status__ignore_untracked(void)
git_submodule_ignore_t ign = GIT_SUBMODULE_IGNORE_UNTRACKED;
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "sm_unchanged"));
- cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_git_pass(git_submodule_foreach(g_repo, set_sm_ignore, &ign));
@@ -195,7 +195,7 @@ void test_submodule_status__ignore_dirty(void)
git_submodule_ignore_t ign = GIT_SUBMODULE_IGNORE_DIRTY;
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "sm_unchanged"));
- cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_git_pass(git_submodule_foreach(g_repo, set_sm_ignore, &ign));
@@ -255,7 +255,7 @@ void test_submodule_status__ignore_all(void)
git_submodule_ignore_t ign = GIT_SUBMODULE_IGNORE_ALL;
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "sm_unchanged"));
- cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), GIT_DIRREMOVAL_FILES_AND_DIRS));
+ cl_git_pass(git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_DIRREMOVAL_FILES_AND_DIRS));
cl_git_pass(git_submodule_foreach(g_repo, set_sm_ignore, &ign));