summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-11-28 13:31:06 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2018-12-01 10:46:44 +0000
commit18e71e6d597abe6c7feb666429c921bd19dc0ba8 (patch)
tree623f04b779ae57c2783b13d8c73d8bd215772721 /tests
parent19faf7c5fcd24fab789d9b7a619b343c1fae7c86 (diff)
downloadlibgit2-18e71e6d597abe6c7feb666429c921bd19dc0ba8.tar.gz
index: use new enum and structure names
Use the new-style index names throughout our own codebase.
Diffstat (limited to 'tests')
-rw-r--r--tests/apply/apply_helpers.c4
-rw-r--r--tests/checkout/conflict.c2
-rw-r--r--tests/checkout/index.c6
-rw-r--r--tests/checkout/tree.c6
-rw-r--r--tests/diff/workdir.c6
-rw-r--r--tests/index/bypath.c4
-rw-r--r--tests/index/collision.c10
-rw-r--r--tests/index/conflicts.c38
-rw-r--r--tests/index/filemodes.c6
-rw-r--r--tests/index/names.c6
-rw-r--r--tests/index/racy.c24
-rw-r--r--tests/index/read_index.c6
-rw-r--r--tests/index/reuc.c6
-rw-r--r--tests/index/tests.c12
-rw-r--r--tests/iterator/index.c24
-rw-r--r--tests/object/tree/duplicateentries.c18
-rw-r--r--tests/reset/hard.c2
-rw-r--r--tests/status/ignore.c2
-rw-r--r--tests/status/renames.c4
-rw-r--r--tests/status/worktree.c6
20 files changed, 96 insertions, 96 deletions
diff --git a/tests/apply/apply_helpers.c b/tests/apply/apply_helpers.c
index c182e0582..91cc51a71 100644
--- a/tests/apply/apply_helpers.c
+++ b/tests/apply/apply_helpers.c
@@ -13,7 +13,7 @@ static int iterator_compare(const git_index_entry *entry, void *_data)
struct iterator_compare_data *data = (struct iterator_compare_data *)_data;
- cl_assert_equal_i(GIT_IDXENTRY_STAGE(entry), data->expected[data->idx].stage);
+ cl_assert_equal_i(GIT_INDEX_ENTRY_STAGE(entry), data->expected[data->idx].stage);
cl_git_pass(git_oid_fromstr(&expected_id, data->expected[data->idx].oid_str));
cl_assert_equal_oid(&entry->id, &expected_id);
cl_assert_equal_i(entry->mode, data->expected[data->idx].mode);
@@ -75,7 +75,7 @@ static int iterator_eq(const git_index_entry **entry, void *_data)
if (!entry[0] || !entry[1])
return -1;
- cl_assert_equal_i(GIT_IDXENTRY_STAGE(entry[0]), GIT_IDXENTRY_STAGE(entry[1]));
+ cl_assert_equal_i(GIT_INDEX_ENTRY_STAGE(entry[0]), GIT_INDEX_ENTRY_STAGE(entry[1]));
cl_assert_equal_oid(&entry[0]->id, &entry[1]->id);
cl_assert_equal_i(entry[0]->mode, entry[1]->mode);
cl_assert_equal_s(entry[0]->path, entry[1]->path);
diff --git a/tests/checkout/conflict.c b/tests/checkout/conflict.c
index 6670b2ec7..abfd9b7c7 100644
--- a/tests/checkout/conflict.c
+++ b/tests/checkout/conflict.c
@@ -103,7 +103,7 @@ static void create_index(struct checkout_index_entry *entries, size_t entries_le
memset(&entry, 0x0, sizeof(git_index_entry));
entry.mode = entries[i].mode;
- GIT_IDXENTRY_STAGE_SET(&entry, entries[i].stage);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, entries[i].stage);
git_oid_fromstr(&entry.id, entries[i].oid_str);
entry.path = entries[i].path;
diff --git a/tests/checkout/index.c b/tests/checkout/index.c
index 65a121d76..a4c811b6f 100644
--- a/tests/checkout/index.c
+++ b/tests/checkout/index.c
@@ -733,15 +733,15 @@ static void add_conflict(git_index *index, const char *path)
entry.path = path;
git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46");
- GIT_IDXENTRY_STAGE_SET(&entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
cl_git_pass(git_index_add(index, &entry));
git_oid_fromstr(&entry.id, "4e886e602529caa9ab11d71f86634bd1b6e0de10");
- GIT_IDXENTRY_STAGE_SET(&entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
cl_git_pass(git_index_add(index, &entry));
git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
- GIT_IDXENTRY_STAGE_SET(&entry, 3);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 3);
cl_git_pass(git_index_add(index, &entry));
}
diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c
index 4008935d6..039393d3f 100644
--- a/tests/checkout/tree.c
+++ b/tests/checkout/tree.c
@@ -941,16 +941,16 @@ static void create_conflict(const char *path)
memset(&entry, 0x0, sizeof(git_index_entry));
entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46");
entry.path = path;
cl_git_pass(git_index_add(index, &entry));
- GIT_IDXENTRY_STAGE_SET(&entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf");
cl_git_pass(git_index_add(index, &entry));
- GIT_IDXENTRY_STAGE_SET(&entry, 3);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 3);
git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
cl_git_pass(git_index_add(index, &entry));
diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c
index dab6147b5..b1d9aef60 100644
--- a/tests/diff/workdir.c
+++ b/tests/diff/workdir.c
@@ -145,12 +145,12 @@ void test_diff_workdir__to_index_with_assume_unchanged(void)
cl_assert((iep = git_index_get_bypath(idx, "modified_file", 0)) != NULL);
memcpy(&ie, iep, sizeof(ie));
- ie.flags |= GIT_IDXENTRY_VALID;
+ ie.flags |= GIT_INDEX_ENTRY_VALID;
cl_git_pass(git_index_add(idx, &ie));
cl_assert((iep = git_index_get_bypath(idx, "file_deleted", 0)) != NULL);
memcpy(&ie, iep, sizeof(ie));
- ie.flags |= GIT_IDXENTRY_VALID;
+ ie.flags |= GIT_INDEX_ENTRY_VALID;
cl_git_pass(git_index_add(idx, &ie));
cl_git_pass(git_index_write(idx));
@@ -749,7 +749,7 @@ void test_diff_workdir__filemode_changes_with_filemode_false(void)
cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, NULL));
memset(&exp, 0, sizeof(exp));
- cl_git_pass(git_diff_foreach(diff,
+ cl_git_pass(git_diff_foreach(diff,
diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp));
cl_assert_equal_i(0, exp.files);
diff --git a/tests/index/bypath.c b/tests/index/bypath.c
index 34a7412a8..f911ffb51 100644
--- a/tests/index/bypath.c
+++ b/tests/index/bypath.c
@@ -285,7 +285,7 @@ void test_index_bypath__add_honors_conflict_mode(void)
cl_git_pass(git_index_remove_bypath(g_idx, "README.txt"));
for (stage = 1; stage <= 3; stage++) {
- new_entry.flags = stage << GIT_IDXENTRY_STAGESHIFT;
+ new_entry.flags = stage << GIT_INDEX_ENTRY_STAGESHIFT;
cl_git_pass(git_index_add(g_idx, &new_entry));
}
@@ -317,7 +317,7 @@ void test_index_bypath__add_honors_conflict_case(void)
cl_git_pass(git_index_remove_bypath(g_idx, "README.txt"));
for (stage = 1; stage <= 3; stage++) {
- new_entry.flags = stage << GIT_IDXENTRY_STAGESHIFT;
+ new_entry.flags = stage << GIT_INDEX_ENTRY_STAGESHIFT;
cl_git_pass(git_index_add(g_idx, &new_entry));
}
diff --git a/tests/index/collision.c b/tests/index/collision.c
index 699c985fe..e9af2cfe4 100644
--- a/tests/index/collision.c
+++ b/tests/index/collision.c
@@ -108,7 +108,7 @@ void test_index_collision__add_with_highstage_1(void)
git_oid_cpy(&entry.id, &g_empty_id);
entry.path = "a/b";
- GIT_IDXENTRY_STAGE_SET(&entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
cl_git_pass(git_index_add(g_index, &entry));
/* create a blob beneath the previous tree entry */
@@ -118,7 +118,7 @@ void test_index_collision__add_with_highstage_1(void)
/* create another tree entry above the blob */
entry.path = "a/b";
- GIT_IDXENTRY_STAGE_SET(&entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
cl_git_pass(git_index_add(g_index, &entry));
}
@@ -134,16 +134,16 @@ void test_index_collision__add_with_highstage_2(void)
git_oid_cpy(&entry.id, &g_empty_id);
entry.path = "a/b/c";
- GIT_IDXENTRY_STAGE_SET(&entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
cl_git_pass(git_index_add(g_index, &entry));
/* create a blob beneath the previous tree entry */
entry.path = "a/b/c";
- GIT_IDXENTRY_STAGE_SET(&entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
cl_git_pass(git_index_add(g_index, &entry));
/* create another tree entry above the blob */
entry.path = "a/b";
- GIT_IDXENTRY_STAGE_SET(&entry, 3);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 3);
cl_git_pass(git_index_add(g_index, &entry));
}
diff --git a/tests/index/conflicts.c b/tests/index/conflicts.c
index 27fbe2b05..41d0e219c 100644
--- a/tests/index/conflicts.c
+++ b/tests/index/conflicts.c
@@ -36,17 +36,17 @@ void test_index_conflicts__add(void)
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
our_entry.path = "test-one.txt";
our_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&our_entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2);
git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
their_entry.path = "test-one.txt";
their_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 2);
git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry));
@@ -67,17 +67,17 @@ void test_index_conflicts__add_fixes_incorrect_stage(void)
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3);
git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
our_entry.path = "test-one.txt";
our_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&our_entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1);
git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
their_entry.path = "test-one.txt";
their_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&their_entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2);
git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry));
@@ -110,17 +110,17 @@ void test_index_conflicts__add_detects_invalid_filemode(void)
for (i = 0; i < 3; i++) {
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3);
git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
our_entry.path = "test-one.txt";
our_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&our_entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1);
git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
their_entry.path = "test-one.txt";
their_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&their_entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2);
git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
/* Corrupt the conflict entry's mode */
@@ -150,17 +150,17 @@ void test_index_conflicts__add_removes_stage_zero(void)
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3);
git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
our_entry.path = "test-one.txt";
our_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&our_entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1);
git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
their_entry.path = "test-one.txt";
their_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&their_entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2);
git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry));
@@ -356,7 +356,7 @@ void test_index_conflicts__partial(void)
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, NULL, NULL));
@@ -386,17 +386,17 @@ void test_index_conflicts__case_matters(void)
memset(&their_entry, 0x0, sizeof(git_index_entry));
ancestor_entry.path = upper_case;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
ancestor_entry.mode = GIT_FILEMODE_BLOB;
our_entry.path = upper_case;
- GIT_IDXENTRY_STAGE_SET(&our_entry, GIT_INDEX_STAGE_OURS);
+ GIT_INDEX_ENTRY_STAGE_SET(&our_entry, GIT_INDEX_STAGE_OURS);
git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
our_entry.mode = GIT_FILEMODE_BLOB;
their_entry.path = upper_case;
- GIT_IDXENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
+ GIT_INDEX_ENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
their_entry.mode = GIT_FILEMODE_BLOB;
@@ -404,17 +404,17 @@ void test_index_conflicts__case_matters(void)
&ancestor_entry, &our_entry, &their_entry));
ancestor_entry.path = mixed_case;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
git_oid_fromstr(&ancestor_entry.id, CONFLICTS_TWO_ANCESTOR_OID);
ancestor_entry.mode = GIT_FILEMODE_BLOB;
our_entry.path = mixed_case;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
git_oid_fromstr(&our_entry.id, CONFLICTS_TWO_OUR_OID);
ancestor_entry.mode = GIT_FILEMODE_BLOB;
their_entry.path = mixed_case;
- GIT_IDXENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
+ GIT_INDEX_ENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
git_oid_fromstr(&their_entry.id, CONFLICTS_TWO_THEIR_OID);
their_entry.mode = GIT_FILEMODE_BLOB;
diff --git a/tests/index/filemodes.c b/tests/index/filemodes.c
index 4eadb2c34..4e5a6df3b 100644
--- a/tests/index/filemodes.c
+++ b/tests/index/filemodes.c
@@ -78,7 +78,7 @@ void test_index_filemodes__untrusted(void)
cl_repo_set_bool(g_repo, "core.filemode", false);
cl_git_pass(git_repository_index(&index, g_repo));
- cl_assert((git_index_caps(index) & GIT_INDEXCAP_NO_FILEMODE) != 0);
+ cl_assert((git_index_caps(index) & GIT_INDEX_CAPABILITY_NO_FILEMODE) != 0);
/* 1 - add 0644 over existing 0644 -> expect 0644 */
replace_file_with_mode("exec_off", "filemodes/exec_off.0", 0644);
@@ -122,7 +122,7 @@ void test_index_filemodes__trusted(void)
cl_repo_set_bool(g_repo, "core.filemode", true);
cl_git_pass(git_repository_index(&index, g_repo));
- cl_assert((git_index_caps(index) & GIT_INDEXCAP_NO_FILEMODE) == 0);
+ cl_assert((git_index_caps(index) & GIT_INDEX_CAPABILITY_NO_FILEMODE) == 0);
/* 1 - add 0644 over existing 0644 -> expect 0644 */
replace_file_with_mode("exec_off", "filemodes/exec_off.0", 0644);
@@ -245,7 +245,7 @@ void test_index_filemodes__invalid(void)
cl_git_pass(git_index_add_bypath(index, "dummy-file.txt"));
cl_assert((dummy = git_index_get_bypath(index, "dummy-file.txt", 0)));
- GIT_IDXENTRY_STAGE_SET(&entry, 0);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, 0);
entry.path = "foo";
entry.mode = GIT_OBJ_BLOB;
git_oid_cpy(&entry.id, &dummy->id);
diff --git a/tests/index/names.c b/tests/index/names.c
index 11d2c416a..e36a66740 100644
--- a/tests/index/names.c
+++ b/tests/index/names.c
@@ -41,21 +41,21 @@ static void index_add_conflicts(void)
/* ancestor */
entry.path = conflict[0];
entry.mode = GIT_FILEMODE_BLOB;
- GIT_IDXENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_ANCESTOR);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_ANCESTOR);
git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81");
cl_git_pass(git_index_add(repo_index, &entry));
/* ours */
entry.path = conflict[1];
entry.mode = GIT_FILEMODE_BLOB;
- GIT_IDXENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_OURS);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_OURS);
git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81");
cl_git_pass(git_index_add(repo_index, &entry));
/* theirs */
entry.path = conflict[2];
entry.mode = GIT_FILEMODE_BLOB;
- GIT_IDXENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_THEIRS);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_THEIRS);
git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81");
cl_git_pass(git_index_add(repo_index, &entry));
}
diff --git a/tests/index/racy.c b/tests/index/racy.c
index a15f0fc87..e08deaea3 100644
--- a/tests/index/racy.c
+++ b/tests/index/racy.c
@@ -210,13 +210,13 @@ void test_index_racy__adding_to_index_is_uptodate(void)
/* ensure that they're all uptodate */
cl_assert((entry = git_index_get_bypath(index, "A", 0)));
- cl_assert_equal_i(GIT_IDXENTRY_UPTODATE, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(GIT_INDEX_ENTRY_UPTODATE, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
cl_assert((entry = git_index_get_bypath(index, "B", 0)));
- cl_assert_equal_i(GIT_IDXENTRY_UPTODATE, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(GIT_INDEX_ENTRY_UPTODATE, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
cl_assert((entry = git_index_get_bypath(index, "C", 0)));
- cl_assert_equal_i(GIT_IDXENTRY_UPTODATE, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(GIT_INDEX_ENTRY_UPTODATE, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
cl_git_pass(git_index_write(index));
@@ -237,13 +237,13 @@ void test_index_racy__reading_clears_uptodate_bit(void)
/* ensure that no files are uptodate */
cl_assert((entry = git_index_get_bypath(index, "A", 0)));
- cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
cl_assert((entry = git_index_get_bypath(index, "B", 0)));
- cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
cl_assert((entry = git_index_get_bypath(index, "C", 0)));
- cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
git_index_free(index);
}
@@ -264,13 +264,13 @@ void test_index_racy__read_tree_clears_uptodate_bit(void)
/* ensure that no files are uptodate */
cl_assert((entry = git_index_get_bypath(index, "A", 0)));
- cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
cl_assert((entry = git_index_get_bypath(index, "B", 0)));
- cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
cl_assert((entry = git_index_get_bypath(index, "C", 0)));
- cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
git_tree_free(tree);
git_index_free(index);
@@ -311,13 +311,13 @@ void test_index_racy__read_index_clears_uptodate_bit(void)
/* ensure that files brought in from the other index are not uptodate */
cl_assert((entry = git_index_get_bypath(newindex, "A", 0)));
- cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
cl_assert((entry = git_index_get_bypath(newindex, "B", 0)));
- cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
cl_assert((entry = git_index_get_bypath(newindex, "C", 0)));
- cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+ cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
git_index_free(index);
git_index_free(newindex);
diff --git a/tests/index/read_index.c b/tests/index/read_index.c
index 2df7cc8eb..836c12b0e 100644
--- a/tests/index/read_index.c
+++ b/tests/index/read_index.c
@@ -147,17 +147,17 @@ static void add_conflicts(git_index *index, const char *filename)
ancestor_entry.path = filename;
ancestor_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
git_oid_fromstr(&ancestor_entry.id, ancestor_ids[conflict_idx]);
our_entry.path = filename;
our_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&our_entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2);
git_oid_fromstr(&our_entry.id, our_ids[conflict_idx]);
their_entry.path = filename;
their_entry.mode = 0100644;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 2);
git_oid_fromstr(&their_entry.id, their_ids[conflict_idx]);
cl_git_pass(git_index_conflict_add(index, &ancestor_entry,
diff --git a/tests/index/reuc.c b/tests/index/reuc.c
index 1489ed13e..73eaf9ef0 100644
--- a/tests/index/reuc.c
+++ b/tests/index/reuc.c
@@ -129,12 +129,12 @@ void test_index_reuc__ignore_case(void)
index_caps = git_index_caps(repo_index);
- index_caps &= ~GIT_INDEXCAP_IGNORE_CASE;
+ index_caps &= ~GIT_INDEX_CAPABILITY_IGNORE_CASE;
cl_git_pass(git_index_set_caps(repo_index, index_caps));
cl_assert(!git_index_reuc_get_bypath(repo_index, "TWO.txt"));
- index_caps |= GIT_INDEXCAP_IGNORE_CASE;
+ index_caps |= GIT_INDEX_CAPABILITY_IGNORE_CASE;
cl_git_pass(git_index_set_caps(repo_index, index_caps));
cl_assert_equal_i(2, git_index_reuc_entrycount(repo_index));
@@ -197,7 +197,7 @@ void test_index_reuc__updates_existing(void)
index_caps = git_index_caps(repo_index);
- index_caps |= GIT_INDEXCAP_IGNORE_CASE;
+ index_caps |= GIT_INDEX_CAPABILITY_IGNORE_CASE;
cl_git_pass(git_index_set_caps(repo_index, index_caps));
git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID);
diff --git a/tests/index/tests.c b/tests/index/tests.c
index de57bd898..49ef8b2cb 100644
--- a/tests/index/tests.c
+++ b/tests/index/tests.c
@@ -810,7 +810,7 @@ void test_index_tests__preserves_case(void)
cl_git_rewritefile("myrepo/TEST.txt", "hello again\n");
cl_git_pass(git_index_add_bypath(index, "TEST.txt"));
- if (index_caps & GIT_INDEXCAP_IGNORE_CASE)
+ if (index_caps & GIT_INDEX_CAPABILITY_IGNORE_CASE)
cl_assert_equal_i(1, (int)git_index_entrycount(index));
else
cl_assert_equal_i(2, (int)git_index_entrycount(index));
@@ -821,7 +821,7 @@ void test_index_tests__preserves_case(void)
cl_assert(git__strcmp(entry->path, "test.txt") == 0);
cl_assert((entry = git_index_get_bypath(index, "TEST.txt", 0)) != NULL);
- if (index_caps & GIT_INDEXCAP_IGNORE_CASE)
+ if (index_caps & GIT_INDEX_CAPABILITY_IGNORE_CASE)
/* The path should *not* have changed without an explicit remove */
cl_assert(git__strcmp(entry->path, "test.txt") == 0);
else
@@ -923,13 +923,13 @@ void test_index_tests__reload_while_ignoring_case(void)
cl_git_pass(git_vector_verify_sorted(&index->entries));
caps = git_index_caps(index);
- cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEXCAP_IGNORE_CASE));
+ cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEX_CAPABILITY_IGNORE_CASE));
cl_git_pass(git_index_read(index, true));
cl_git_pass(git_vector_verify_sorted(&index->entries));
cl_assert(git_index_get_bypath(index, ".HEADER", 0));
cl_assert_equal_p(NULL, git_index_get_bypath(index, ".header", 0));
- cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE));
+ cl_git_pass(git_index_set_caps(index, caps | GIT_INDEX_CAPABILITY_IGNORE_CASE));
cl_git_pass(git_index_read(index, true));
cl_git_pass(git_vector_verify_sorted(&index->entries));
cl_assert(git_index_get_bypath(index, ".HEADER", 0));
@@ -948,7 +948,7 @@ void test_index_tests__change_icase_on_instance(void)
cl_git_pass(git_vector_verify_sorted(&index->entries));
caps = git_index_caps(index);
- cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEXCAP_IGNORE_CASE));
+ cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEX_CAPABILITY_IGNORE_CASE));
cl_assert_equal_i(false, index->ignore_case);
cl_git_pass(git_vector_verify_sorted(&index->entries));
cl_assert(e = git_index_get_bypath(index, "src/common.h", 0));
@@ -956,7 +956,7 @@ void test_index_tests__change_icase_on_instance(void)
cl_assert(e = git_index_get_bypath(index, "COPYING", 0));
cl_assert_equal_p(NULL, e = git_index_get_bypath(index, "copying", 0));
- cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE));
+ cl_git_pass(git_index_set_caps(index, caps | GIT_INDEX_CAPABILITY_IGNORE_CASE));
cl_assert_equal_i(true, index->ignore_case);
cl_git_pass(git_vector_verify_sorted(&index->entries));
cl_assert(e = git_index_get_bypath(index, "COPYING", 0));
diff --git a/tests/iterator/index.c b/tests/iterator/index.c
index 7de0d12c4..8c7efb253 100644
--- a/tests/iterator/index.c
+++ b/tests/iterator/index.c
@@ -222,10 +222,10 @@ static void check_index_range(
cl_git_pass(git_repository_index(&index, repo));
caps = git_index_caps(index);
- is_ignoring_case = ((caps & GIT_INDEXCAP_IGNORE_CASE) != 0);
+ is_ignoring_case = ((caps & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0);
if (ignore_case != is_ignoring_case)
- cl_git_pass(git_index_set_caps(index, caps ^ GIT_INDEXCAP_IGNORE_CASE));
+ cl_git_pass(git_index_set_caps(index, caps ^ GIT_INDEX_CAPABILITY_IGNORE_CASE));
i_opts.flags = 0;
i_opts.start = start;
@@ -363,7 +363,7 @@ void test_iterator_index__icase_1(void)
caps = git_index_caps(index);
/* force case sensitivity */
- cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEXCAP_IGNORE_CASE));
+ cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEX_CAPABILITY_IGNORE_CASE));
/* autoexpand with no tree entries over range */
i_opts.start = "c";
@@ -409,7 +409,7 @@ void test_iterator_index__icase_1(void)
git_iterator_free(i);
/* force case insensitivity */
- cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE));
+ cl_git_pass(git_index_set_caps(index, caps | GIT_INDEX_CAPABILITY_IGNORE_CASE));
/* autoexpand with no tree entries over range */
i_opts.flags = 0;
@@ -783,7 +783,7 @@ void test_iterator_index__pathlist_1(void)
cl_git_pass(git_vector_insert(&filelist, "k/a"));
/* In this test we DO NOT force a case setting on the index. */
- default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0);
+ default_icase = ((git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0);
i_opts.pathlist.strings = (char **)filelist.contents;
i_opts.pathlist.count = filelist.length;
@@ -825,7 +825,7 @@ void test_iterator_index__pathlist_2(void)
cl_git_pass(git_vector_insert(&filelist, "kZZZZZZZ"));
/* In this test we DO NOT force a case setting on the index. */
- default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0);
+ default_icase = ((git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0);
i_opts.pathlist.strings = (char **)filelist.contents;
i_opts.pathlist.count = filelist.length;
@@ -867,7 +867,7 @@ void test_iterator_index__pathlist_four(void)
cl_git_pass(git_vector_insert(&filelist, "kZZZZZZZ"));
/* In this test we DO NOT force a case setting on the index. */
- default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0);
+ default_icase = ((git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0);
i_opts.pathlist.strings = (char **)filelist.contents;
i_opts.pathlist.count = filelist.length;
@@ -910,7 +910,7 @@ void test_iterator_index__pathlist_icase(void)
caps = git_index_caps(index);
/* force case sensitivity */
- cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEXCAP_IGNORE_CASE));
+ cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEX_CAPABILITY_IGNORE_CASE));
/* All indexfilelist iterator tests are "autoexpand with no tree entries" */
@@ -930,7 +930,7 @@ void test_iterator_index__pathlist_icase(void)
git_iterator_free(i);
/* force case insensitivity */
- cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE));
+ cl_git_pass(git_index_set_caps(index, caps | GIT_INDEX_CAPABILITY_IGNORE_CASE));
i_opts.start = "c";
i_opts.end = "k/D";
@@ -1297,17 +1297,17 @@ static void add_conflict(
ancestor.path = ancestor_path;
ancestor.mode = GIT_FILEMODE_BLOB;
git_oid_fromstr(&ancestor.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
- GIT_IDXENTRY_STAGE_SET(&ancestor, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor, 1);
ours.path = our_path;
ours.mode = GIT_FILEMODE_BLOB;
git_oid_fromstr(&ours.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
- GIT_IDXENTRY_STAGE_SET(&ours, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&ours, 2);
theirs.path = their_path;
theirs.mode = GIT_FILEMODE_BLOB;
git_oid_fromstr(&theirs.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
- GIT_IDXENTRY_STAGE_SET(&theirs, 3);
+ GIT_INDEX_ENTRY_STAGE_SET(&theirs, 3);
cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs));
}
diff --git a/tests/object/tree/duplicateentries.c b/tests/object/tree/duplicateentries.c
index 35dd383ec..c11ae0d3d 100644
--- a/tests/object/tree/duplicateentries.c
+++ b/tests/object/tree/duplicateentries.c
@@ -18,9 +18,9 @@ void test_object_tree_duplicateentries__cleanup(void) {
* parent cf80f8de9f1185bf3a05f993f6121880dd0cfbc9
* author Ben Straub <bstraub@github.com> 1343755506 -0700
* committer Ben Straub <bstraub@github.com> 1343755506 -0700
- *
+ *
* Change a file mode
- *
+ *
* diff --git a/a/b.txt b/a/b.txt
* old mode 100644
* new mode 100755
@@ -69,7 +69,7 @@ static void two_blobs(git_treebuilder *bld)
{
git_oid oid;
const git_tree_entry *entry;
-
+
cl_git_pass(git_oid_fromstr(&oid,
"a8233120f6ad708f843d861ce2b7228ec4e3dec6")); /* blob oid (README) */
@@ -89,7 +89,7 @@ static void one_blob_and_one_tree(git_treebuilder *bld)
{
git_oid oid;
const git_tree_entry *entry;
-
+
cl_git_pass(git_oid_fromstr(&oid,
"a8233120f6ad708f843d861ce2b7228ec4e3dec6")); /* blob oid (README) */
@@ -111,7 +111,7 @@ void test_object_tree_duplicateentries__cannot_create_a_duplicate_entry_through_
tree_creator(&tid, two_blobs);
tree_checker(&tid, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd", GIT_FILEMODE_BLOB);
-
+
tree_creator(&tid, one_blob_and_one_tree);
tree_checker(&tid, "4e0883eeeeebc1fb1735161cea82f7cb5fab7e63", GIT_FILEMODE_TREE);
}
@@ -126,17 +126,17 @@ static void add_fake_conflicts(git_index *index)
ancestor_entry.path = "duplicate";
ancestor_entry.mode = GIT_FILEMODE_BLOB;
- GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1);
+ GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
git_oid_fromstr(&ancestor_entry.id, "a8233120f6ad708f843d861ce2b7228ec4e3dec6");
our_entry.path = "duplicate";
our_entry.mode = GIT_FILEMODE_BLOB;
- GIT_IDXENTRY_STAGE_SET(&our_entry, 2);
+ GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2);
git_oid_fromstr(&our_entry.id, "45b983be36b73c0788dc9cbcb76cbb80fc7bb057");
their_entry.path = "duplicate";
their_entry.mode = GIT_FILEMODE_BLOB;
- GIT_IDXENTRY_STAGE_SET(&their_entry, 3);
+ GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 3);
git_oid_fromstr(&their_entry.id, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd");
cl_git_pass(git_index_conflict_add(index, &ancestor_entry, &our_entry, &their_entry));
@@ -149,7 +149,7 @@ void test_object_tree_duplicateentries__cannot_create_a_duplicate_entry_building
cl_git_pass(git_repository_index(&index, _repo));
- add_fake_conflicts(index);
+ add_fake_conflicts(index);
cl_assert_equal_i(GIT_EUNMERGED, git_index_write_tree(&tid, index));
diff --git a/tests/reset/hard.c b/tests/reset/hard.c
index c63640e1c..d47ddd842 100644
--- a/tests/reset/hard.c
+++ b/tests/reset/hard.c
@@ -108,7 +108,7 @@ static void index_entry_init(git_index *index, int side, git_oid *oid)
memset(&entry, 0x0, sizeof(git_index_entry));
entry.path = "conflicting_file";
- GIT_IDXENTRY_STAGE_SET(&entry, side);
+ GIT_INDEX_ENTRY_STAGE_SET(&entry, side);
entry.mode = 0100644;
git_oid_cpy(&entry.id, oid);
diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index c986a6b3c..496582136 100644
--- a/tests/status/ignore.c
+++ b/tests/status/ignore.c
@@ -167,7 +167,7 @@ void test_status_ignore__ignore_pattern_ignorecase(void)
cl_git_mkfile("empty_standard_repo/A.txt", "Differs in case");
cl_git_pass(git_repository_index(&index, g_repo));
- ignore_case = (git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0;
+ ignore_case = (git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
git_index_free(index);
cl_git_pass(git_status_file(&flags, g_repo, "A.txt"));
diff --git a/tests/status/renames.c b/tests/status/renames.c
index 445995264..7deec980f 100644
--- a/tests/status/renames.c
+++ b/tests/status/renames.c
@@ -483,7 +483,7 @@ void test_status_renames__both_casechange_one(void)
cl_git_pass(git_status_list_new(&statuslist, g_repo, &opts));
- check_status(statuslist, (index_caps & GIT_INDEXCAP_IGNORE_CASE) ?
+ check_status(statuslist, (index_caps & GIT_INDEX_CAPABILITY_IGNORE_CASE) ?
expected_icase : expected_case, 1);
git_status_list_free(statuslist);
@@ -550,7 +550,7 @@ void test_status_renames__both_casechange_two(void)
cl_git_pass(git_status_list_new(&statuslist, g_repo, &opts));
- check_status(statuslist, (index_caps & GIT_INDEXCAP_IGNORE_CASE) ?
+ check_status(statuslist, (index_caps & GIT_INDEX_CAPABILITY_IGNORE_CASE) ?
expected_icase : expected_case, 4);
git_status_list_free(statuslist);
diff --git a/tests/status/worktree.c b/tests/status/worktree.c
index 7abc703db..a83813ef4 100644
--- a/tests/status/worktree.c
+++ b/tests/status/worktree.c
@@ -154,7 +154,7 @@ void test_status_worktree__swap_subdir_and_file(void)
bool ignore_case;
cl_git_pass(git_repository_index(&index, repo));
- ignore_case = (git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0;
+ ignore_case = (git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
git_index_free(index);
/* first alter the contents of the worktree */
@@ -889,7 +889,7 @@ void test_status_worktree__sorting_by_case(void)
cl_git_pass(git_repository_index(&index, repo));
native_ignore_case =
- (git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0;
+ (git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
git_index_free(index);
memset(&counts, 0, sizeof(counts));
@@ -1222,7 +1222,7 @@ void test_status_worktree__with_directory_in_pathlist(void)
cl_git_pass(git_repository_index(&index, repo));
native_ignore_case =
- (git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0;
+ (git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
git_index_free(index);
opts.pathspec.strings = &subdir_path;