libgit2

git_refdb_backend

Version:

An instance for a custom backend

Signature

typedef struct git_refdb_backend { unsigned int version int (*)(int *, git_refdb_backend *, const char *) exists int (*)(git_reference **, git_refdb_backend *, const char *) lookup int (*)(git_reference_iterator **, struct git_refdb_backend *, const char *) iterator int (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *) write int (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *) rename int (*)(git_refdb_backend *, const char *, const git_oid *, const char *) del int (*)(git_refdb_backend *) compress int (*)(git_refdb_backend *, const char *) has_log int (*)(git_refdb_backend *, const char *) ensure_log void (*)(git_refdb_backend *) free int (*)(git_reflog **, git_refdb_backend *, const char *) reflog_read int (*)(git_refdb_backend *, git_reflog *) reflog_write int (*)(git_refdb_backend *, const char *, const char *) reflog_rename int (*)(git_refdb_backend *, const char *) reflog_delete int (*)(void **, git_refdb_backend *, const char *) lock int (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *) unlock };

Members

unsigned int
version
int (*)(int *, 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 **, git_refdb_backend *, const char *)
lookup

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

int (*)(git_reference_iterator **, struct git_refdb_backend *, const char *)
iterator

Allocate an iterator object for the backend.

A refdb implementation must provide this function.

int (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *)
write
int (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *)
rename
int (*)(git_refdb_backend *, const char *, const git_oid *, const char *)
del

Deletes the given reference (and if necessary its reflog) from the refdb. A refdb implementation must provide this function.

int (*)(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.

int (*)(git_refdb_backend *, const char *)
has_log

Query whether a particular reference has a log (may be empty)

int (*)(git_refdb_backend *, const char *)
ensure_log

Make sure a particular reference will have a reflog which will be appended to on writes.

void (*)(git_refdb_backend *)
free

Frees any resources held by the refdb (including the git_refdb_backend itself). A refdb backend implementation must provide this function.

int (*)(git_reflog **, git_refdb_backend *, const char *)
reflog_read

Read the reflog for the given reference name.

int (*)(git_refdb_backend *, git_reflog *)
reflog_write

Write a reflog to disk.

int (*)(git_refdb_backend *, const char *, const char *)
reflog_rename

Rename a reflog

int (*)(git_refdb_backend *, const char *)
reflog_delete

Remove a reflog.

int (*)(void **, git_refdb_backend *, const char *)
lock

Lock a reference. The opaque parameter will be passed to the unlock function

int (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *)
unlock

Unlock a reference. Only one of target or symbolic_target will be set. success indicates whether to update the reference or discard the lock (if it's false)

Parameter To

Versions