summaryrefslogtreecommitdiff
path: root/tests/libgit2/odb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libgit2/odb')
-rw-r--r--tests/libgit2/odb/backend/backend_helpers.c3
-rw-r--r--tests/libgit2/odb/sorting.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/libgit2/odb/backend/backend_helpers.c b/tests/libgit2/odb/backend/backend_helpers.c
index c1a0070d6..3a113da85 100644
--- a/tests/libgit2/odb/backend/backend_helpers.c
+++ b/tests/libgit2/odb/backend/backend_helpers.c
@@ -155,6 +155,9 @@ int build_fake_backend(
GIT_ERROR_CHECK_ALLOC(backend);
backend->parent.version = GIT_ODB_BACKEND_VERSION;
+#ifdef GIT_EXPERIMENTAL_SHA256
+ backend->parent.oid_type = GIT_OID_SHA1;
+#endif
backend->objects = objects;
diff --git a/tests/libgit2/odb/sorting.c b/tests/libgit2/odb/sorting.c
index ec4e3696b..a26b9404e 100644
--- a/tests/libgit2/odb/sorting.c
+++ b/tests/libgit2/odb/sorting.c
@@ -15,8 +15,11 @@ static git_odb_backend *new_backend(size_t position)
if (b == NULL)
return NULL;
- b->base.free = (void (*)(git_odb_backend *)) git__free;
b->base.version = GIT_ODB_BACKEND_VERSION;
+#ifdef GIT_EXPERIMENTAL_SHA256
+ b->base.oid_type = GIT_OID_SHA1;
+#endif
+ b->base.free = (void (*)(git_odb_backend *)) git__free;
b->position = position;
return (git_odb_backend *)b;
}