Skip to content

Commit 983e627

Browse files
committed
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.
1 parent c4cbb3b commit 983e627

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/odb/backend/backend_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int fake_backend__exists(git_odb_backend *backend, const git_oid *oid)
3434

3535
fake->exists_calls++;
3636

37-
return search_object(NULL, fake, oid, GIT_OID_RAWSZ) == GIT_OK;
37+
return search_object(NULL, fake, oid, GIT_OID_HEXSZ) == GIT_OK;
3838
}
3939

4040
static int fake_backend__read(

0 commit comments

Comments
 (0)