summaryrefslogtreecommitdiff
path: root/tests/libgit2/odb/backend/backend_helpers.h
blob: 32d7a8bf03b986126fadc2764fbe2795be1f5280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "git2/sys/odb_backend.h"

typedef struct {
	const char *oid;
	const char *content;
} fake_object;

typedef struct {
	git_odb_backend parent;

	int exists_calls;
	int exists_prefix_calls;
	int read_calls;
	int read_header_calls;
	int read_prefix_calls;
	int refresh_calls;

	const fake_object *objects;
} fake_backend;

int build_fake_backend(
	git_odb_backend **out,
	const fake_object *objects,
	bool support_refresh);