libgit2

git_refdb_backend

Version:

An instance for a custom backend

Signature

typedef struct git_refdb_backend { unsigned int version int (*)(int *, struct git_refdb_backend *, const char *) exists int (*)(git_reference **, struct git_refdb_backend *, const char *) lookup int (*)(struct git_refdb_backend *, unsigned int, git_reference_foreach_cb, void *) foreach int (*)(struct git_refdb_backend *, const char *, unsigned int, git_reference_foreach_cb, void *) foreach_glob int (*)(struct git_refdb_backend *, const git_reference *) write int (*)(struct git_refdb_backend *, const git_reference *) delete int (*)(struct git_refdb_backend *) compress void (*)(struct git_refdb_backend *) free };

Members

unsigned int
version
int (*)(int *, struct git_refdb_backend *, const char *)
exists

Queries the refdb backend to determine if the given ref_name exists. A refdb implementation must provide this function.

int (*)(git_reference **, struct git_refdb_backend *, const char *)
lookup

Queries the refdb backend for a given reference. A refdb implementation must provide this function.

int (*)(struct git_refdb_backend *, unsigned int, git_reference_foreach_cb, void *)
foreach

Enumerates each reference in the refdb. A refdb implementation must provide this function.

int (*)(struct git_refdb_backend *, const char *, unsigned int, git_reference_foreach_cb, void *)
foreach_glob

Enumerates each reference in the refdb that matches the given glob string. A refdb implementation may provide this function; if it is not provided, foreach will be used and the results filtered against the glob.

int (*)(struct git_refdb_backend *, const git_reference *)
write

Writes the given reference to the refdb. A refdb implementation must provide this function.

int (*)(struct git_refdb_backend *, const git_reference *)
delete

Deletes the given reference from the refdb. A refdb implementation must provide this function.

int (*)(struct git_refdb_backend *)
compress

Suggests that the given refdb compress or optimize its references. This mechanism is implementation specific. (For on-disk reference databases, this may pack all loose references.) A refdb implementation may provide this function; if it is not provided, nothing will be done.

void (*)(struct git_refdb_backend *)
free

Frees any resources held by the refdb. A refdb implementation may provide this function; if it is not provided, nothing will be done.

Parameter To

Versions