2 #include "test_helpers.h"
5 static char *odb_dir
= "test-objects";
7 /* one == 8b137891791fe96927ad78e64b0aad7bded08bdc */
8 static unsigned char one_bytes
[] = {
9 0x31, 0x78, 0x9c, 0xe3, 0x02, 0x00, 0x00, 0x0b,
13 static unsigned char one_data
[] = {
17 static object_data one
= {
20 "8b137891791fe96927ad78e64b0aad7bded08bdc",
23 "test-objects/8b/137891791fe96927ad78e64b0aad7bded08bdc",
29 BEGIN_TEST(exists_loose_one
)
33 must_pass(write_object_files(odb_dir
, &one
));
34 must_pass(git_odb_open(&db
, odb_dir
));
35 must_pass(git_oid_mkstr(&id
, one
.id
));
37 must_be_true(git_odb_exists(db
, &id
));
39 /* Test for a non-existant object */
40 must_pass(git_oid_mkstr(&id2
, "8b137891791fe96927ad78e64b0aad7bded08baa"));
41 must_be_true(0 == git_odb_exists(db
, &id2
));
44 must_pass(remove_object_files(odb_dir
, &one
));