summaryrefslogtreecommitdiff
path: root/tests/libgit2/odb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libgit2/odb')
-rw-r--r--tests/libgit2/odb/alternates.c4
-rw-r--r--tests/libgit2/odb/backend/backend_helpers.c6
-rw-r--r--tests/libgit2/odb/backend/mempack.c4
-rw-r--r--tests/libgit2/odb/backend/multiple.c2
-rw-r--r--tests/libgit2/odb/backend/nonrefreshing.c4
-rw-r--r--tests/libgit2/odb/backend/refreshing.c4
-rw-r--r--tests/libgit2/odb/backend/simple.c26
-rw-r--r--tests/libgit2/odb/emptyobjects.c6
-rw-r--r--tests/libgit2/odb/freshen.c12
-rw-r--r--tests/libgit2/odb/largefiles.c4
-rw-r--r--tests/libgit2/odb/loose.c14
-rw-r--r--tests/libgit2/odb/mixed.c26
-rw-r--r--tests/libgit2/odb/packed.c6
-rw-r--r--tests/libgit2/odb/packed_one.c4
14 files changed, 61 insertions, 61 deletions
diff --git a/tests/libgit2/odb/alternates.c b/tests/libgit2/odb/alternates.c
index 6c00fda2f..0e14e1d8f 100644
--- a/tests/libgit2/odb/alternates.c
+++ b/tests/libgit2/odb/alternates.c
@@ -52,7 +52,7 @@ void test_odb_alternates__chained(void)
/* Now load B and see if we can find an object from testrepo.git */
cl_git_pass(git_repository_open(&repo, paths[1]));
- git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
git_commit_free(commit);
git_repository_free(repo);
@@ -74,7 +74,7 @@ void test_odb_alternates__long_chain(void)
/* Now load the last one and see if we can find an object from testrepo.git */
cl_git_pass(git_repository_open(&repo, paths[ARRAY_SIZE(paths)-1]));
- git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_fail(git_commit_lookup(&commit, repo, &oid));
git_repository_free(repo);
}
diff --git a/tests/libgit2/odb/backend/backend_helpers.c b/tests/libgit2/odb/backend/backend_helpers.c
index c595e4744..337c11cf6 100644
--- a/tests/libgit2/odb/backend/backend_helpers.c
+++ b/tests/libgit2/odb/backend/backend_helpers.c
@@ -9,7 +9,7 @@ static int search_object(const fake_object **out, fake_backend *fake, const git_
while (obj && obj->oid) {
git_oid current_oid;
- git_oid_fromstr(&current_oid, obj->oid);
+ git_oid_fromstr(&current_oid, obj->oid, GIT_OID_SHA1);
if (git_oid_ncmp(&current_oid, oid, len) == 0) {
if (found)
@@ -52,7 +52,7 @@ static int fake_backend__exists_prefix(
return error;
if (out)
- git_oid_fromstr(out, obj->oid);
+ git_oid_fromstr(out, obj->oid, GIT_OID_SHA1);
return 0;
}
@@ -115,7 +115,7 @@ static int fake_backend__read_prefix(
if ((error = search_object(&obj, fake, short_oid, len)) < 0)
return error;
- git_oid_fromstr(out_oid, obj->oid);
+ git_oid_fromstr(out_oid, obj->oid, GIT_OID_SHA1);
*len_p = strlen(obj->content);
*buffer_p = git__strdup(obj->content);
*type_p = GIT_OBJECT_BLOB;
diff --git a/tests/libgit2/odb/backend/mempack.c b/tests/libgit2/odb/backend/mempack.c
index 2eeed51aa..7e0da3fb8 100644
--- a/tests/libgit2/odb/backend/mempack.c
+++ b/tests/libgit2/odb/backend/mempack.c
@@ -34,13 +34,13 @@ void test_odb_backend_mempack__write_succeeds(void)
void test_odb_backend_mempack__read_of_missing_object_fails(void)
{
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633", GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND, git_odb_read(&_obj, _odb, &_oid));
}
void test_odb_backend_mempack__exists_of_missing_object_fails(void)
{
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633", GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &_oid) == 0);
}
diff --git a/tests/libgit2/odb/backend/multiple.c b/tests/libgit2/odb/backend/multiple.c
index 5f1eacd52..ee751aeb3 100644
--- a/tests/libgit2/odb/backend/multiple.c
+++ b/tests/libgit2/odb/backend/multiple.c
@@ -24,7 +24,7 @@ void test_odb_backend_multiple__initialize(void)
{
git_odb_backend *backend;
- git_oid_fromstr(&_existing_oid, EXISTING_HASH);
+ git_oid_fromstr(&_existing_oid, EXISTING_HASH, GIT_OID_SHA1);
_obj = NULL;
_repo = cl_git_sandbox_init("testrepo.git");
diff --git a/tests/libgit2/odb/backend/nonrefreshing.c b/tests/libgit2/odb/backend/nonrefreshing.c
index 2db10efbc..5fb7a4d81 100644
--- a/tests/libgit2/odb/backend/nonrefreshing.c
+++ b/tests/libgit2/odb/backend/nonrefreshing.c
@@ -33,8 +33,8 @@ static void setup_repository_and_backend(void)
void test_odb_backend_nonrefreshing__initialize(void)
{
- git_oid_fromstr(&_nonexisting_oid, NONEXISTING_HASH);
- git_oid_fromstr(&_existing_oid, EXISTING_HASH);
+ git_oid_fromstr(&_nonexisting_oid, NONEXISTING_HASH, GIT_OID_SHA1);
+ git_oid_fromstr(&_existing_oid, EXISTING_HASH, GIT_OID_SHA1);
setup_repository_and_backend();
}
diff --git a/tests/libgit2/odb/backend/refreshing.c b/tests/libgit2/odb/backend/refreshing.c
index 9e49298a8..39c55c267 100644
--- a/tests/libgit2/odb/backend/refreshing.c
+++ b/tests/libgit2/odb/backend/refreshing.c
@@ -33,8 +33,8 @@ static void setup_repository_and_backend(void)
void test_odb_backend_refreshing__initialize(void)
{
- git_oid_fromstr(&_nonexisting_oid, NONEXISTING_HASH);
- git_oid_fromstr(&_existing_oid, EXISTING_HASH);
+ git_oid_fromstr(&_nonexisting_oid, NONEXISTING_HASH, GIT_OID_SHA1);
+ git_oid_fromstr(&_existing_oid, EXISTING_HASH, GIT_OID_SHA1);
setup_repository_and_backend();
}
diff --git a/tests/libgit2/odb/backend/simple.c b/tests/libgit2/odb/backend/simple.c
index d2051f821..c6545f301 100644
--- a/tests/libgit2/odb/backend/simple.c
+++ b/tests/libgit2/odb/backend/simple.c
@@ -49,7 +49,7 @@ void test_odb_backend_simple__read_of_object_succeeds(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_odb_read(&_obj, _odb, &_oid));
assert_object_contains(_obj, objs[0].content);
@@ -64,7 +64,7 @@ void test_odb_backend_simple__read_of_nonexisting_object_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633", GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND, git_odb_read(&_obj, _odb, &_oid));
}
@@ -77,7 +77,7 @@ void test_odb_backend_simple__read_with_hash_mismatch_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_fail_with(GIT_EMISMATCH, git_odb_read(&_obj, _odb, &_oid));
}
@@ -89,7 +89,7 @@ void test_odb_backend_simple__read_with_hash_mismatch_succeeds_without_verificat
};
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 0));
cl_git_pass(git_odb_read(&_obj, _odb, &_oid));
@@ -106,7 +106,7 @@ void test_odb_backend_simple__read_prefix_succeeds(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4632"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4632", GIT_OID_SHA1));
cl_git_pass(git_odb_read(&_obj, _odb, &_oid));
assert_object_contains(_obj, objs[0].content);
@@ -122,7 +122,7 @@ void test_odb_backend_simple__read_prefix_of_nonexisting_object_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstrn(&_oid, hash, strlen(hash)));
+ cl_git_pass(git_oid_fromstrn(&_oid, hash, strlen(hash), GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND, git_odb_read(&_obj, _odb, &_oid));
}
@@ -136,7 +136,7 @@ void test_odb_backend_simple__read_with_ambiguous_prefix_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_fail_with(GIT_EAMBIGUOUS, git_odb_read_prefix(&_obj, _odb, &_oid, 7));
}
@@ -150,7 +150,7 @@ void test_odb_backend_simple__read_with_highly_ambiguous_prefix(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 0));
cl_git_fail_with(GIT_EAMBIGUOUS, git_odb_read_prefix(&_obj, _odb, &_oid, 39));
cl_git_pass(git_odb_read_prefix(&_obj, _odb, &_oid, 40));
@@ -166,7 +166,7 @@ void test_odb_backend_simple__exists_succeeds(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &_oid));
}
@@ -179,7 +179,7 @@ void test_odb_backend_simple__exists_fails_for_nonexisting_object(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633", GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &_oid) == 0);
}
@@ -194,7 +194,7 @@ void test_odb_backend_simple__exists_prefix_succeeds(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &_oid, 12));
cl_assert(git_oid_equal(&found, &_oid));
}
@@ -209,7 +209,7 @@ void test_odb_backend_simple__exists_with_ambiguous_prefix_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_fail_with(GIT_EAMBIGUOUS, git_odb_exists_prefix(NULL, _odb, &_oid, 7));
}
@@ -224,7 +224,7 @@ void test_odb_backend_simple__exists_with_highly_ambiguous_prefix(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 0));
cl_git_fail_with(GIT_EAMBIGUOUS, git_odb_exists_prefix(&found, _odb, &_oid, 39));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &_oid, 40));
diff --git a/tests/libgit2/odb/emptyobjects.c b/tests/libgit2/odb/emptyobjects.c
index e3ec62d3f..cc287935e 100644
--- a/tests/libgit2/odb/emptyobjects.c
+++ b/tests/libgit2/odb/emptyobjects.c
@@ -24,7 +24,7 @@ void test_odb_emptyobjects__blob_notfound(void)
git_oid id, written_id;
git_blob *blob;
- cl_git_pass(git_oid_fromstr(&id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"));
+ cl_git_pass(git_oid_fromstr(&id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND, git_blob_lookup(&blob, g_repo, &id));
cl_git_pass(git_odb_write(&written_id, g_odb, "", 0, GIT_OBJECT_BLOB));
@@ -36,7 +36,7 @@ void test_odb_emptyobjects__read_tree(void)
git_oid id;
git_tree *tree;
- cl_git_pass(git_oid_fromstr(&id, "4b825dc642cb6eb9a060e54bf8d69288fbee4904"));
+ cl_git_pass(git_oid_fromstr(&id, "4b825dc642cb6eb9a060e54bf8d69288fbee4904", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
cl_assert_equal_i(GIT_OBJECT_TREE, git_object_type((git_object *) tree));
cl_assert_equal_i(0, git_tree_entrycount(tree));
@@ -49,7 +49,7 @@ void test_odb_emptyobjects__read_tree_odb(void)
git_oid id;
git_odb_object *tree_odb;
- cl_git_pass(git_oid_fromstr(&id, "4b825dc642cb6eb9a060e54bf8d69288fbee4904"));
+ cl_git_pass(git_oid_fromstr(&id, "4b825dc642cb6eb9a060e54bf8d69288fbee4904", GIT_OID_SHA1));
cl_git_pass(git_odb_read(&tree_odb, g_odb, &id));
cl_assert(git_odb_object_data(tree_odb));
cl_assert_equal_s("", git_odb_object_data(tree_odb));
diff --git a/tests/libgit2/odb/freshen.c b/tests/libgit2/odb/freshen.c
index 2396e3774..ceacede2e 100644
--- a/tests/libgit2/odb/freshen.c
+++ b/tests/libgit2/odb/freshen.c
@@ -43,7 +43,7 @@ void test_odb_freshen__loose_blob(void)
git_oid expected_id, id;
struct stat before, after;
- cl_git_pass(git_oid_fromstr(&expected_id, LOOSE_BLOB_ID));
+ cl_git_pass(git_oid_fromstr(&expected_id, LOOSE_BLOB_ID, GIT_OID_SHA1));
set_time_wayback(&before, LOOSE_BLOB_FN);
/* make sure we freshen a blob */
@@ -64,7 +64,7 @@ void test_odb_freshen__readonly_object(void)
git_oid expected_id, id;
struct stat before, after;
- cl_git_pass(git_oid_fromstr(&expected_id, UNIQUE_BLOB_ID));
+ cl_git_pass(git_oid_fromstr(&expected_id, UNIQUE_BLOB_ID, GIT_OID_SHA1));
cl_git_pass(git_blob_create_from_buffer(&id, repo, UNIQUE_STR, CONST_STRLEN(UNIQUE_STR)));
cl_assert_equal_oid(&expected_id, &id);
@@ -89,7 +89,7 @@ void test_odb_freshen__loose_tree(void)
git_tree *tree;
struct stat before, after;
- cl_git_pass(git_oid_fromstr(&expected_id, LOOSE_TREE_ID));
+ cl_git_pass(git_oid_fromstr(&expected_id, LOOSE_TREE_ID, GIT_OID_SHA1));
set_time_wayback(&before, LOOSE_TREE_FN);
cl_git_pass(git_tree_lookup(&tree, repo, &expected_id));
@@ -113,11 +113,11 @@ void test_odb_freshen__tree_during_commit(void)
git_signature *signature;
struct stat before, after;
- cl_git_pass(git_oid_fromstr(&tree_id, LOOSE_TREE_ID));
+ cl_git_pass(git_oid_fromstr(&tree_id, LOOSE_TREE_ID, GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, repo, &tree_id));
set_time_wayback(&before, LOOSE_TREE_FN);
- cl_git_pass(git_oid_fromstr(&parent_id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
+ cl_git_pass(git_oid_fromstr(&parent_id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&parent, repo, &parent_id));
cl_git_pass(git_signature_new(&signature,
@@ -147,7 +147,7 @@ void test_odb_freshen__packed_object(void)
struct stat before, after;
struct p_timeval old_times[2];
- cl_git_pass(git_oid_fromstr(&expected_id, PACKED_ID));
+ cl_git_pass(git_oid_fromstr(&expected_id, PACKED_ID, GIT_OID_SHA1));
old_times[0].tv_sec = 1234567890;
old_times[0].tv_usec = 0;
diff --git a/tests/libgit2/odb/largefiles.c b/tests/libgit2/odb/largefiles.c
index acc786ee4..0ecbd6f6b 100644
--- a/tests/libgit2/odb/largefiles.c
+++ b/tests/libgit2/odb/largefiles.c
@@ -57,7 +57,7 @@ void test_odb_largefiles__write_from_memory(void)
for (i = 0; i < (3041*126103); i++)
cl_git_pass(git_str_puts(&buf, "Hello, world.\n"));
- git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c");
+ git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c", GIT_OID_SHA1);
cl_git_pass(git_odb_write(&oid, odb, buf.ptr, buf.size, GIT_OBJECT_BLOB));
cl_assert_equal_oid(&expected, &oid);
@@ -75,7 +75,7 @@ void test_odb_largefiles__streamwrite(void)
!cl_is_env_set("GITTEST_SLOW"))
cl_skip();
- git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c");
+ git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c", GIT_OID_SHA1);
writefile(&oid);
cl_assert_equal_oid(&expected, &oid);
diff --git a/tests/libgit2/odb/loose.c b/tests/libgit2/odb/loose.c
index fe013a78c..7fea9a6d9 100644
--- a/tests/libgit2/odb/loose.c
+++ b/tests/libgit2/odb/loose.c
@@ -42,7 +42,7 @@ static void test_read_object(object_data *data)
write_object_files(data);
cl_git_pass(git_odb_open(&odb, "test-objects"));
- cl_git_pass(git_oid_fromstr(&id, data->id));
+ cl_git_pass(git_oid_fromstr(&id, data->id, GIT_OID_SHA1));
cl_git_pass(git_odb_read(&obj, odb, &id));
tmp.data = obj->buffer;
@@ -65,7 +65,7 @@ static void test_read_header(object_data *data)
write_object_files(data);
cl_git_pass(git_odb_open(&odb, "test-objects"));
- cl_git_pass(git_oid_fromstr(&id, data->id));
+ cl_git_pass(git_oid_fromstr(&id, data->id, GIT_OID_SHA1));
cl_git_pass(git_odb_read_header(&len, &type, odb, &id));
cl_assert_equal_sz(data->dlen, len);
@@ -87,7 +87,7 @@ static void test_readstream_object(object_data *data, size_t blocksize)
write_object_files(data);
cl_git_pass(git_odb_open(&odb, "test-objects"));
- cl_git_pass(git_oid_fromstr(&id, data->id));
+ cl_git_pass(git_oid_fromstr(&id, data->id, GIT_OID_SHA1));
cl_git_pass(git_odb_open_rstream(&stream, &tmp.len, &tmp.type, odb, &id));
remain = tmp.len;
@@ -132,18 +132,18 @@ void test_odb_loose__exists(void)
write_object_files(&one);
cl_git_pass(git_odb_open(&odb, "test-objects"));
- cl_git_pass(git_oid_fromstr(&id, one.id));
+ cl_git_pass(git_oid_fromstr(&id, one.id, GIT_OID_SHA1));
cl_assert(git_odb_exists(odb, &id));
- cl_git_pass(git_oid_fromstrp(&id, "8b137891"));
+ cl_git_pass(git_oid_fromstrp(&id, "8b137891", GIT_OID_SHA1));
cl_git_pass(git_odb_exists_prefix(&id2, odb, &id, 8));
cl_assert_equal_i(0, git_oid_streq(&id2, one.id));
/* Test for a missing object */
- cl_git_pass(git_oid_fromstr(&id, "8b137891791fe96927ad78e64b0aad7bded08baa"));
+ cl_git_pass(git_oid_fromstr(&id, "8b137891791fe96927ad78e64b0aad7bded08baa", GIT_OID_SHA1));
cl_assert(!git_odb_exists(odb, &id));
- cl_git_pass(git_oid_fromstrp(&id, "8b13789a"));
+ cl_git_pass(git_oid_fromstrp(&id, "8b13789a", GIT_OID_SHA1));
cl_assert_equal_i(GIT_ENOTFOUND, git_odb_exists_prefix(&id2, odb, &id, 8));
git_odb_free(odb);
diff --git a/tests/libgit2/odb/mixed.c b/tests/libgit2/odb/mixed.c
index 70eda8237..e9869fe77 100644
--- a/tests/libgit2/odb/mixed.c
+++ b/tests/libgit2/odb/mixed.c
@@ -20,13 +20,13 @@ void test_odb_mixed__dup_oid(void) {
git_oid oid;
git_odb_object *obj;
- cl_git_pass(git_oid_fromstr(&oid, hex));
+ cl_git_pass(git_oid_fromstr(&oid, hex, GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, GIT_OID_SHA1_HEXSIZE));
git_odb_object_free(obj);
cl_git_pass(git_odb_exists_prefix(NULL, _odb, &oid, GIT_OID_SHA1_HEXSIZE));
- cl_git_pass(git_oid_fromstrn(&oid, short_hex, sizeof(short_hex) - 1));
+ cl_git_pass(git_oid_fromstrn(&oid, short_hex, sizeof(short_hex) - 1, GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, sizeof(short_hex) - 1));
git_odb_object_free(obj);
@@ -48,63 +48,63 @@ void test_odb_mixed__dup_oid_prefix_0(void) {
/* ambiguous in the same pack file */
strncpy(hex, "dea509d0", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
strncpy(hex, "dea509d09", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
cl_assert_equal_oid(&found, git_odb_object_id(obj));
git_odb_object_free(obj);
strncpy(hex, "dea509d0b", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
git_odb_object_free(obj);
/* ambiguous in different pack files */
strncpy(hex, "81b5bff5", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
strncpy(hex, "81b5bff5b", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
cl_assert_equal_oid(&found, git_odb_object_id(obj));
git_odb_object_free(obj);
strncpy(hex, "81b5bff5f", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
git_odb_object_free(obj);
/* ambiguous in pack file and loose */
strncpy(hex, "0ddeaded", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
strncpy(hex, "0ddeaded9", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
cl_assert_equal_oid(&found, git_odb_object_id(obj));
git_odb_object_free(obj);
strncpy(hex, "0ddeadede", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
git_odb_object_free(obj);
}
@@ -170,7 +170,7 @@ static void setup_prefix_query(
size_t len = strlen(expand_id_test_data[i].lookup_id);
- git_oid_fromstrn(&id->id, expand_id_test_data[i].lookup_id, len);
+ git_oid_fromstrn(&id->id, expand_id_test_data[i].lookup_id, len, GIT_OID_SHA1);
id->length = (unsigned short)len;
id->type = expand_id_test_data[i].expected_type;
}
@@ -191,7 +191,7 @@ static void assert_found_objects(git_odb_expand_id *ids)
git_object_t expected_type = 0;
if (expand_id_test_data[i].expected_id) {
- git_oid_fromstr(&expected_id, expand_id_test_data[i].expected_id);
+ git_oid_fromstr(&expected_id, expand_id_test_data[i].expected_id, GIT_OID_SHA1);
expected_len = GIT_OID_SHA1_HEXSIZE;
expected_type = expand_id_test_data[i].expected_type;
}
diff --git a/tests/libgit2/odb/packed.c b/tests/libgit2/odb/packed.c
index 3d502ed6d..2f5a8a231 100644
--- a/tests/libgit2/odb/packed.c
+++ b/tests/libgit2/odb/packed.c
@@ -23,7 +23,7 @@ void test_odb_packed__mass_read(void)
git_oid id;
git_odb_object *obj;
- cl_git_pass(git_oid_fromstr(&id, packed_objects[i]));
+ cl_git_pass(git_oid_fromstr(&id, packed_objects[i], GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &id) == 1);
cl_git_pass(git_odb_read(&obj, _odb, &id));
@@ -41,7 +41,7 @@ void test_odb_packed__read_header_0(void)
size_t len;
git_object_t type;
- cl_git_pass(git_oid_fromstr(&id, packed_objects[i]));
+ cl_git_pass(git_oid_fromstr(&id, packed_objects[i], GIT_OID_SHA1));
cl_git_pass(git_odb_read(&obj, _odb, &id));
cl_git_pass(git_odb_read_header(&len, &type, _odb, &id));
@@ -63,7 +63,7 @@ void test_odb_packed__read_header_1(void)
size_t len;
git_object_t type;
- cl_git_pass(git_oid_fromstr(&id, loose_objects[i]));
+ cl_git_pass(git_oid_fromstr(&id, loose_objects[i], GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &id) == 1);
diff --git a/tests/libgit2/odb/packed_one.c b/tests/libgit2/odb/packed_one.c
index 17cd4f760..a708839cc 100644
--- a/tests/libgit2/odb/packed_one.c
+++ b/tests/libgit2/odb/packed_one.c
@@ -29,7 +29,7 @@ void test_odb_packed_one__mass_read(void)
git_oid id;
git_odb_object *obj;
- cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i]));
+ cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i], GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &id) == 1);
cl_git_pass(git_odb_read(&obj, _odb, &id));
@@ -47,7 +47,7 @@ void test_odb_packed_one__read_header_0(void)
size_t len;
git_object_t type;
- cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i]));
+ cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i], GIT_OID_SHA1));
cl_git_pass(git_odb_read(&obj, _odb, &id));
cl_git_pass(git_odb_read_header(&len, &type, _odb, &id));