libgit2

git_mempack_dump

Version:

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).

Signature

int git_mempack_dump(git_buf *pack, git_repository *repo, git_odb_backend *backend);

Parameters

In
pack

Buffer where to store the raw packfile

In
repo

The active repository where the backend is loaded

In
backend

The mempack backend

Returns

int

0 on success; error code otherwise

Versions