summaryrefslogtreecommitdiff
path: root/tests-clar/index
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar/index')
-rw-r--r--tests-clar/index/names.c22
-rw-r--r--tests-clar/index/reuc.c34
2 files changed, 28 insertions, 28 deletions
diff --git a/tests-clar/index/names.c b/tests-clar/index/names.c
index 68615531a..95a560ee4 100644
--- a/tests-clar/index/names.c
+++ b/tests-clar/index/names.c
@@ -21,7 +21,7 @@ void test_index_names__cleanup(void)
{
git_index_free(repo_index);
repo_index = NULL;
-
+
cl_git_sandbox_cleanup();
}
@@ -32,14 +32,14 @@ void test_index_names__add(void)
cl_git_pass(git_index_name_add(repo_index, "ancestor", "ours", "theirs"));
cl_git_pass(git_index_name_add(repo_index, "ancestor2", "ours2", NULL));
cl_git_pass(git_index_name_add(repo_index, "ancestor3", NULL, "theirs3"));
-
+
cl_assert(git_index_name_entrycount(repo_index) == 3);
-
+
conflict_name = git_index_name_get_byindex(repo_index, 0);
cl_assert(strcmp(conflict_name->ancestor, "ancestor") == 0);
cl_assert(strcmp(conflict_name->ours, "ours") == 0);
cl_assert(strcmp(conflict_name->theirs, "theirs") == 0);
-
+
conflict_name = git_index_name_get_byindex(repo_index, 1);
cl_assert(strcmp(conflict_name->ancestor, "ancestor2") == 0);
cl_assert(strcmp(conflict_name->ours, "ours2") == 0);
@@ -54,31 +54,31 @@ void test_index_names__add(void)
void test_index_names__roundtrip(void)
{
const git_index_name_entry *conflict_name;
-
+
cl_git_pass(git_index_name_add(repo_index, "ancestor", "ours", "theirs"));
cl_git_pass(git_index_name_add(repo_index, "ancestor2", "ours2", NULL));
cl_git_pass(git_index_name_add(repo_index, "ancestor3", NULL, "theirs3"));
-
+
cl_git_pass(git_index_write(repo_index));
git_index_clear(repo_index);
cl_assert(git_index_name_entrycount(repo_index) == 0);
-
+
cl_git_pass(git_index_read(repo_index));
cl_assert(git_index_name_entrycount(repo_index) == 3);
-
+
conflict_name = git_index_name_get_byindex(repo_index, 0);
cl_assert(strcmp(conflict_name->ancestor, "ancestor") == 0);
cl_assert(strcmp(conflict_name->ours, "ours") == 0);
cl_assert(strcmp(conflict_name->theirs, "theirs") == 0);
-
+
conflict_name = git_index_name_get_byindex(repo_index, 1);
cl_assert(strcmp(conflict_name->ancestor, "ancestor2") == 0);
cl_assert(strcmp(conflict_name->ours, "ours2") == 0);
cl_assert(conflict_name->theirs == NULL);
-
+
conflict_name = git_index_name_get_byindex(repo_index, 2);
cl_assert(strcmp(conflict_name->ancestor, "ancestor3") == 0);
cl_assert(conflict_name->ours == NULL);
cl_assert(strcmp(conflict_name->theirs, "theirs3") == 0);
-
+
}
diff --git a/tests-clar/index/reuc.c b/tests-clar/index/reuc.c
index 0e38a92f3..69ed4a933 100644
--- a/tests-clar/index/reuc.c
+++ b/tests-clar/index/reuc.c
@@ -232,7 +232,7 @@ void test_index_reuc__remove(void)
cl_git_pass(git_index_reuc_remove(repo_index, 0));
cl_git_fail(git_index_reuc_remove(repo_index, 1));
-
+
cl_assert_equal_i(1, git_index_reuc_entrycount(repo_index));
cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 0));
@@ -283,7 +283,7 @@ void test_index_reuc__write(void)
/* ensure sort order was round-tripped correct */
cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 0));
cl_assert_equal_s("one.txt", reuc->path);
-
+
cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 1));
cl_assert_equal_s("two.txt", reuc->path);
}
@@ -296,41 +296,41 @@ static int reuc_entry_exists(void)
void test_index_reuc__cleaned_on_reset_hard(void)
{
git_object *target;
-
+
retrieve_target_from_oid(&target, repo, "3a34580a35add43a4cf361e8e9a30060a905c876");
-
+
test_index_reuc__add();
cl_git_pass(git_reset(repo, target, GIT_RESET_HARD));
cl_assert(reuc_entry_exists() == false);
-
+
git_object_free(target);
}
void test_index_reuc__cleaned_on_reset_mixed(void)
{
git_object *target;
-
+
retrieve_target_from_oid(&target, repo, "3a34580a35add43a4cf361e8e9a30060a905c876");
- test_index_reuc__add();
+ test_index_reuc__add();
cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED));
cl_assert(reuc_entry_exists() == false);
-
+
git_object_free(target);
}
void test_index_reuc__retained_on_reset_soft(void)
{
git_object *target;
-
+
retrieve_target_from_oid(&target, repo, "3a34580a35add43a4cf361e8e9a30060a905c876");
-
+
git_reset(repo, target, GIT_RESET_HARD);
test_index_reuc__add();
cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT));
cl_assert(reuc_entry_exists() == true);
-
+
git_object_free(target);
}
@@ -339,7 +339,7 @@ void test_index_reuc__cleaned_on_checkout_tree(void)
git_oid oid;
git_object *obj;
git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
-
+
opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY;
test_index_reuc__add();
@@ -347,16 +347,16 @@ void test_index_reuc__cleaned_on_checkout_tree(void)
git_object_lookup(&obj, repo, &oid, GIT_OBJ_ANY);
git_checkout_tree(repo, obj, &opts);
cl_assert(reuc_entry_exists() == false);
-
+
git_object_free(obj);
}
void test_index_reuc__cleaned_on_checkout_head(void)
{
git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
-
+
opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY;
-
+
test_index_reuc__add();
git_checkout_head(repo, &opts);
cl_assert(reuc_entry_exists() == false);
@@ -365,9 +365,9 @@ void test_index_reuc__cleaned_on_checkout_head(void)
void test_index_reuc__retained_on_checkout_index(void)
{
git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
-
+
opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY;
-
+
test_index_reuc__add();
git_checkout_index(repo, repo_index, &opts);
cl_assert(reuc_entry_exists() == true);