diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2022-01-22 23:10:03 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2022-06-14 22:29:57 -0400 |
commit | dbc4ac1c76827e954e0aa27afe8bb7e0b8993a93 (patch) | |
tree | 56f18a11bca8d17490a176cddf9e3756c2cebe91 /tests/libgit2/odb | |
parent | f98dd5438f8d7bfd557b612fdf1605b1c3fb8eaf (diff) | |
download | libgit2-dbc4ac1c76827e954e0aa27afe8bb7e0b8993a93.tar.gz |
oid: `GIT_OID_*SZ` is now `GIT_OID_SHA1_*SIZE`
In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ`
need to indicate that they're the size of _SHA1_ OIDs.
Diffstat (limited to 'tests/libgit2/odb')
-rw-r--r-- | tests/libgit2/odb/backend/backend_helpers.c | 6 | ||||
-rw-r--r-- | tests/libgit2/odb/mixed.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/libgit2/odb/backend/backend_helpers.c b/tests/libgit2/odb/backend/backend_helpers.c index 542799242..c595e4744 100644 --- a/tests/libgit2/odb/backend/backend_helpers.c +++ b/tests/libgit2/odb/backend/backend_helpers.c @@ -34,7 +34,7 @@ static int fake_backend__exists(git_odb_backend *backend, const git_oid *oid) fake->exists_calls++; - return search_object(NULL, fake, oid, GIT_OID_HEXSZ) == GIT_OK; + return search_object(NULL, fake, oid, GIT_OID_SHA1_HEXSIZE) == GIT_OK; } static int fake_backend__exists_prefix( @@ -69,7 +69,7 @@ static int fake_backend__read( fake->read_calls++; - if ((error = search_object(&obj, fake, oid, GIT_OID_HEXSZ)) < 0) + if ((error = search_object(&obj, fake, oid, GIT_OID_SHA1_HEXSIZE)) < 0) return error; *len_p = strlen(obj->content); @@ -91,7 +91,7 @@ static int fake_backend__read_header( fake->read_header_calls++; - if ((error = search_object(&obj, fake, oid, GIT_OID_HEXSZ)) < 0) + if ((error = search_object(&obj, fake, oid, GIT_OID_SHA1_HEXSIZE)) < 0) return error; *len_p = strlen(obj->content); diff --git a/tests/libgit2/odb/mixed.c b/tests/libgit2/odb/mixed.c index 87e945c83..cbab8e362 100644 --- a/tests/libgit2/odb/mixed.c +++ b/tests/libgit2/odb/mixed.c @@ -21,10 +21,10 @@ void test_odb_mixed__dup_oid(void) { git_odb_object *obj; cl_git_pass(git_oid_fromstr(&oid, hex)); - cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, GIT_OID_HEXSZ)); + 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_HEXSZ)); + 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_odb_read_prefix(&obj, _odb, &oid, sizeof(short_hex) - 1)); @@ -192,7 +192,7 @@ static void assert_found_objects(git_odb_expand_id *ids) if (expand_id_test_data[i].expected_id) { git_oid_fromstr(&expected_id, expand_id_test_data[i].expected_id); - expected_len = GIT_OID_HEXSZ; + expected_len = GIT_OID_SHA1_HEXSIZE; expected_type = expand_id_test_data[i].expected_type; } |