summaryrefslogtreecommitdiff
path: root/tests/libgit2/iterator
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-23 09:47:01 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-20 17:05:29 -0400
commit3fbf580c91935ccdea25a135204419991f503b63 (patch)
tree53ec861796641faf8895a1f19444c1939ac6be9a /tests/libgit2/iterator
parent61838295a055c8c7a4a7eb730538c6e08a38dd6a (diff)
downloadlibgit2-3fbf580c91935ccdea25a135204419991f503b63.tar.gz
oid: give oids a type
`git_oid`s now have a type, and we require the oid type when creating the object id from creation functions.
Diffstat (limited to 'tests/libgit2/iterator')
-rw-r--r--tests/libgit2/iterator/index.c10
-rw-r--r--tests/libgit2/iterator/tree.c6
-rw-r--r--tests/libgit2/iterator/workdir.c2
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/libgit2/iterator/index.c b/tests/libgit2/iterator/index.c
index 7218b4f75..a4a3447fe 100644
--- a/tests/libgit2/iterator/index.c
+++ b/tests/libgit2/iterator/index.c
@@ -52,7 +52,7 @@ static void index_iterator_test(
if (expected_oids != NULL) {
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, expected_oids[count]));
+ cl_git_pass(git_oid_fromstr(&oid, expected_oids[count], GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
}
@@ -999,7 +999,7 @@ static void create_paths(git_index *index, const char *root, int depth)
memset(&entry, 0, sizeof(git_index_entry));
entry.path = fullpath.ptr;
entry.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&entry.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
+ git_oid_fromstr(&entry.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6", GIT_OID_SHA1);
cl_git_pass(git_index_add(index, &entry));
} else if (depth > 0) {
@@ -1296,17 +1296,17 @@ static void add_conflict(
ancestor.path = ancestor_path;
ancestor.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&ancestor.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
+ git_oid_fromstr(&ancestor.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6", GIT_OID_SHA1);
GIT_INDEX_ENTRY_STAGE_SET(&ancestor, 1);
ours.path = our_path;
ours.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&ours.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
+ git_oid_fromstr(&ours.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6", GIT_OID_SHA1);
GIT_INDEX_ENTRY_STAGE_SET(&ours, 2);
theirs.path = their_path;
theirs.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&theirs.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
+ git_oid_fromstr(&theirs.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6", GIT_OID_SHA1);
GIT_INDEX_ENTRY_STAGE_SET(&theirs, 3);
cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs));
diff --git a/tests/libgit2/iterator/tree.c b/tests/libgit2/iterator/tree.c
index 06a920a18..30d87f8a2 100644
--- a/tests/libgit2/iterator/tree.c
+++ b/tests/libgit2/iterator/tree.c
@@ -675,7 +675,7 @@ void test_iterator_tree__case_conflicts_0(void)
g_repo = cl_git_sandbox_init("icase");
- cl_git_pass(git_oid_fromstr(&blob_id, blob_sha)); /* lookup blob */
+ cl_git_pass(git_oid_fromstr(&blob_id, blob_sha, GIT_OID_SHA1)); /* lookup blob */
/* create tree with: A/1.file, A/3.file, a/2.file, a/4.file */
build_test_tree(
@@ -729,7 +729,7 @@ void test_iterator_tree__case_conflicts_1(void)
g_repo = cl_git_sandbox_init("icase");
- cl_git_pass(git_oid_fromstr(&blob_id, blob_sha)); /* lookup blob */
+ cl_git_pass(git_oid_fromstr(&blob_id, blob_sha, GIT_OID_SHA1)); /* lookup blob */
/* create: A/a A/b/1 A/c a/a a/b a/C */
build_test_tree(&Ab_id, g_repo, "b|1|", &blob_id);
@@ -798,7 +798,7 @@ void test_iterator_tree__case_conflicts_2(void)
g_repo = cl_git_sandbox_init("icase");
- cl_git_pass(git_oid_fromstr(&blob_id, blob_sha)); /* lookup blob */
+ cl_git_pass(git_oid_fromstr(&blob_id, blob_sha, GIT_OID_SHA1)); /* lookup blob */
build_test_tree(&d1, g_repo, "b|16|,b|foo|", &blob_id, &blob_id);
build_test_tree(&d2, g_repo, "b|15|,b|FOO|", &blob_id, &blob_id);
diff --git a/tests/libgit2/iterator/workdir.c b/tests/libgit2/iterator/workdir.c
index 112cd9a4e..b2f481ef3 100644
--- a/tests/libgit2/iterator/workdir.c
+++ b/tests/libgit2/iterator/workdir.c
@@ -1514,7 +1514,7 @@ void test_iterator_workdir__hash_when_requested(void)
for (i = 0; i < sizeof(expected) / sizeof(struct merge_index_entry); i++) {
cl_git_pass(git_iterator_advance(&entry, iter));
- cl_git_pass(git_oid_fromstr(&expected_id, expected[i].oid_str));
+ cl_git_pass(git_oid_fromstr(&expected_id, expected[i].oid_str, GIT_OID_SHA1));
cl_assert_equal_oid(&expected_id, &entry->id);
cl_assert_equal_s(expected[i].path, entry->path);
}