libgit2.odb

Members

Aliases

git_odb_foreach_cb
alias git_odb_foreach_cb = int function(const(libgit2.oid.git_oid)* id, void* payload)

Function type for callbacks from git_odb_foreach.

Enums

GIT_ODB_LOOKUP_NO_REFRESH
anonymousenum GIT_ODB_LOOKUP_NO_REFRESH
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
git_odb_lookup_flags_t
enum git_odb_lookup_flags_t

Flags controlling the behavior of ODB lookup operations

Functions

GIT_ODB_OPTIONS_INIT
GIT_ODB_OPTIONS_INIT()

Stack initializer for odb options. Alternatively use git_odb_options_init programmatic initialization.

git_odb_add_alternate
int git_odb_add_alternate(libgit2.types.git_odb* odb, libgit2.types.git_odb_backend* backend, int priority)

Add a custom backend to an existing Object DB; this backend will work as an alternate.

git_odb_add_backend
int git_odb_add_backend(libgit2.types.git_odb* odb, libgit2.types.git_odb_backend* backend, int priority)

Add a custom backend to an existing Object DB

git_odb_add_disk_alternate
int git_odb_add_disk_alternate(libgit2.types.git_odb* odb, const(char)* path)

Add an on-disk alternate to an existing Object DB.

git_odb_exists
int git_odb_exists(libgit2.types.git_odb* db, const(libgit2.oid.git_oid)* id)

Determine if the given object can be found in the object database.

git_odb_exists_ext
int git_odb_exists_ext(libgit2.types.git_odb* db, const(libgit2.oid.git_oid)* id, uint flags)

Determine if the given object can be found in the object database, with extended options.

git_odb_exists_prefix
int git_odb_exists_prefix(libgit2.oid.git_oid* out_, libgit2.types.git_odb* db, const(libgit2.oid.git_oid)* short_id, size_t len)

Determine if an object can be found in the object database by an abbreviated object ID.

git_odb_expand_ids
int git_odb_expand_ids(libgit2.types.git_odb* db, .git_odb_expand_id* ids, size_t count)

Determine if one or more objects can be found in the object database by their abbreviated object ID and type.

git_odb_foreach
int git_odb_foreach(libgit2.types.git_odb* db, .git_odb_foreach_cb cb, void* payload)

List all objects available in the database

git_odb_free
void git_odb_free(libgit2.types.git_odb* db)

Close an open object database.

git_odb_get_backend
int git_odb_get_backend(libgit2.types.git_odb_backend** out_, libgit2.types.git_odb* odb, size_t pos)

Lookup an ODB backend object by index

git_odb_hash
int git_odb_hash(libgit2.oid.git_oid* out_, const(void)* data, size_t len, libgit2.types.git_object_t object_type, libgit2.oid.git_oid_t oid_type)

Determine the object-ID (sha1 or sha256 hash) of a data buffer

git_odb_hash
int git_odb_hash(libgit2.oid.git_oid* out_, const(void)* data, size_t len, libgit2.types.git_object_t type)

Determine the object-ID (sha1 or sha256 hash) of a data buffer

git_odb_hashfile
int git_odb_hashfile(libgit2.oid.git_oid* out_, const(char)* path, libgit2.types.git_object_t object_type, libgit2.oid.git_oid_t oid_type)

Read a file from disk and fill a git_oid with the object id that the file would have if it were written to the Object Database as an object of the given type (w/o applying filters). Similar functionality to git.git's git hash-object without the -w flag, however, with the --no-filters flag. If you need filters, see git_repository_hashfile.

git_odb_hashfile
int git_odb_hashfile(libgit2.oid.git_oid* out_, const(char)* path, libgit2.types.git_object_t type)

Read a file from disk and fill a git_oid with the object id that the file would have if it were written to the Object Database as an object of the given type (w/o applying filters). Similar functionality to git.git's git hash-object without the -w flag, however, with the --no-filters flag. If you need filters, see git_repository_hashfile.

git_odb_new
int git_odb_new(libgit2.types.git_odb** out_, const(.git_odb_options)* opts)

Create a new object database with no backends.

git_odb_new
int git_odb_new(libgit2.types.git_odb** out_)

Create a new object database with no backends.

git_odb_num_backends
size_t git_odb_num_backends(libgit2.types.git_odb* odb)

Get the number of ODB backend objects

git_odb_object_data
const(void)* git_odb_object_data(libgit2.types.git_odb_object* object)

Return the data of an ODB object

git_odb_object_dup
int git_odb_object_dup(libgit2.types.git_odb_object** dest, libgit2.types.git_odb_object* source)

Create a copy of an odb_object

git_odb_object_free
void git_odb_object_free(libgit2.types.git_odb_object* object)

Close an ODB object

git_odb_object_id
const(libgit2.oid.git_oid)* git_odb_object_id(libgit2.types.git_odb_object* object)

Return the OID of an ODB object

git_odb_object_size
size_t git_odb_object_size(libgit2.types.git_odb_object* object)

Return the size of an ODB object

git_odb_object_type
libgit2.types.git_object_t git_odb_object_type(libgit2.types.git_odb_object* object)

Return the type of an ODB object

git_odb_open
int git_odb_open(libgit2.types.git_odb** out_, const(char)* objects_dir, const(.git_odb_options)* opts)

Create a new object database and automatically add the two default backends:

git_odb_open
int git_odb_open(libgit2.types.git_odb** out_, const(char)* objects_dir)

Create a new object database and automatically add the two default backends:

git_odb_open_rstream
int git_odb_open_rstream(libgit2.types.git_odb_stream** out_, size_t* len, libgit2.types.git_object_t* type, libgit2.types.git_odb* db, const(libgit2.oid.git_oid)* oid)

Open a stream to read an object from the ODB

git_odb_open_wstream
int git_odb_open_wstream(libgit2.types.git_odb_stream** out_, libgit2.types.git_odb* db, libgit2.types.git_object_size_t size, libgit2.types.git_object_t type)

Open a stream to write an object into the ODB

git_odb_read
int git_odb_read(libgit2.types.git_odb_object** out_, libgit2.types.git_odb* db, const(libgit2.oid.git_oid)* id)

Read an object from the database.

git_odb_read_header
int git_odb_read_header(size_t* len_out, libgit2.types.git_object_t* type_out, libgit2.types.git_odb* db, const(libgit2.oid.git_oid)* id)

Read the header of an object from the database, without reading its full contents.

git_odb_read_prefix
int git_odb_read_prefix(libgit2.types.git_odb_object** out_, libgit2.types.git_odb* db, const(libgit2.oid.git_oid)* short_id, size_t len)

Read an object from the database, given a prefix of its identifier.

git_odb_refresh
int git_odb_refresh(libgit2.types.git_odb* db)

Refresh the object database to load newly added files.

git_odb_set_commit_graph
int git_odb_set_commit_graph(libgit2.types.git_odb* odb, libgit2.types.git_commit_graph* cgraph)

Set the git commit-graph for the ODB.

git_odb_stream_finalize_write
int git_odb_stream_finalize_write(libgit2.oid.git_oid* out_, libgit2.types.git_odb_stream* stream)

Finish writing to an odb stream

git_odb_stream_free
void git_odb_stream_free(libgit2.types.git_odb_stream* stream)

Free an odb stream

git_odb_stream_read
int git_odb_stream_read(libgit2.types.git_odb_stream* stream, char* buffer, size_t len)

Read from an odb stream

git_odb_stream_write
int git_odb_stream_write(libgit2.types.git_odb_stream* stream, const(char)* buffer, size_t len)

Write to an odb stream

git_odb_write
int git_odb_write(libgit2.oid.git_oid* out_, libgit2.types.git_odb* odb, const(void)* data, size_t len, libgit2.types.git_object_t type)

Write an object directly into the ODB

git_odb_write_multi_pack_index
int git_odb_write_multi_pack_index(libgit2.types.git_odb* db)

Write a multi-pack-index file from all the .pack files in the ODB.

git_odb_write_pack
int git_odb_write_pack(libgit2.types.git_odb_writepack** out_, libgit2.types.git_odb* db, libgit2.indexer.git_indexer_progress_cb progress_cb, void* progress_payload)

Open a stream for writing a pack file to the ODB.

Manifest constants

GIT_ODB_OPTIONS_VERSION
enum GIT_ODB_OPTIONS_VERSION;

The current version of the diff options structure

Structs

git_odb_expand_id
struct git_odb_expand_id

The information about object IDs to query in git_odb_expand_ids, which will be populated upon return.

git_odb_options
struct git_odb_options

Options for configuring a loose object backend.

Meta

License

GPL-2.0(Linking Exception)