git_mempack_dump

Dump all the queued in-memory writes to a packfile.

The contents of the packfile will be stored in the given buffer. It is the caller's responsibility to ensure that the generated packfile is available to the repository (e.g. by writing it to disk, or doing something crazy like distributing it across several copies of the repository over a network).

Once the generated packfile is available to the repository, call git_mempack_reset to cleanup the memory store.

Calling git_mempack_reset before the packfile has been written to disk will result in an inconsistent repository (the objects in the memory store won't be accessible).

Parameters

pack libgit2_d.buffer.git_buf*

Buffer where to store the raw packfile

repo libgit2_d.types.git_repository*

The active repository where the backend is loaded

backend libgit2_d.types.git_odb_backend*

The mempack backend

Return Value

Type: int

0 on success; error code otherwise

Meta