mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 20:02:04 +00:00

The fake backend currently implements all reading functions except for the `exists_prefix` one. Implement it to enable further testing of the ODB layer.
23 lines
386 B
C
23 lines
386 B
C
#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;
|
|
|
|
const fake_object *objects;
|
|
} fake_backend;
|
|
|
|
int build_fake_backend(
|
|
git_odb_backend **out,
|
|
const fake_object *objects);
|