2 #include "test_helpers.h"
6 static char *odb_dir
= "test-objects";
8 /* one == 8b137891791fe96927ad78e64b0aad7bded08bdc */
9 static unsigned char one_bytes
[] = {
10 0x31, 0x78, 0x9c, 0xe3, 0x02, 0x00, 0x00, 0x0b,
14 static unsigned char one_data
[] = {
18 static object_data one
= {
21 "8b137891791fe96927ad78e64b0aad7bded08bdc",
24 "test-objects/8b/137891791fe96927ad78e64b0aad7bded08bdc",
30 BEGIN_TEST(exists_loose_one
)
34 must_pass(write_object_files(odb_dir
, &one
));
35 must_pass(git_odb_open(&db
, odb_dir
));
36 must_pass(git_oid_mkstr(&id
, one
.id
));
38 must_be_true(git_odb_exists(db
, &id
));
40 /* Test for a non-existant object */
41 must_pass(git_oid_mkstr(&id2
,"8b137891791fe96927ad78e64b0aad7bded08baa"));
42 must_be_true(0 == git_odb_exists(db
, &id2
));
45 must_pass(remove_object_files(odb_dir
, &one
));