summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-06-13 11:38:59 +0200
committerPatrick Steinhardt <ps@pks.im>2017-06-13 11:41:29 +0200
commit983e627d10215807d2727cc8321d83d02f11fee7 (patch)
tree7101df6377f058cdbb45a984e6c02454253e9b4a
parentc4cbb3b16ebbdd26890075a718d59d6e01637d00 (diff)
downloadlibgit2-983e627d10215807d2727cc8321d83d02f11fee7.tar.gz
tests: odb: use correct OID length
The `search_object` function takes the OID length as one of its parameters, where its maximum length is `GIT_OID_HEXSZ`. The `exists` function of the fake backend used `GIT_OID_RAWSZ` though, leading to only the first half of the OID being used when finding the correct object.
-rw-r--r--tests/odb/backend/backend_helpers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/odb/backend/backend_helpers.c b/tests/odb/backend/backend_helpers.c
index 331713680..f9211e706 100644
--- a/tests/odb/backend/backend_helpers.c
+++ b/tests/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_RAWSZ) == GIT_OK;
+ return search_object(NULL, fake, oid, GIT_OID_HEXSZ) == GIT_OK;
}
static int fake_backend__read(