Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
29afb257
Commit
29afb257
authored
Mar 22, 2018
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: fix incorrect codeblock on output
parent
bf70fa4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
35 deletions
+35
-35
include/git2/sys/mempack.h
+35
-35
No files found.
include/git2/sys/mempack.h
View file @
29afb257
...
...
@@ -23,61 +23,61 @@
GIT_BEGIN_DECL
/**
*
Instantiate a new mempack backend.
*
Instantiate a new mempack backend.
*
*
The backend must be added to an existing ODB with the highest
*
priority.
*
The backend must be added to an existing ODB with the highest
*
priority.
*
*
git_mempack_new(&mempacker);
*
git_repository_odb(&odb, repository);
*
git_odb_add_backend(odb, mempacker, 999);
*
git_mempack_new(&mempacker);
*
git_repository_odb(&odb, repository);
*
git_odb_add_backend(odb, mempacker, 999);
*
*
Once the backend has been loaded, all writes to the ODB will
*
instead be queued in memory, and can be finalized with
*
`git_mempack_dump`.
*
Once the backend has been loaded, all writes to the ODB will
*
instead be queued in memory, and can be finalized with
*
`git_mempack_dump`.
*
*
Subsequent reads will also be served from the in-memory store
*
to ensure consistency, until the memory store is dumped.
*
Subsequent reads will also be served from the in-memory store
*
to ensure consistency, until the memory store is dumped.
*
*
@param out Pointer where to store the ODB backend
*
@return 0 on success; error code otherwise
*
@param out Pointer where to store the ODB backend
*
@return 0 on success; error code otherwise
*/
GIT_EXTERN
(
int
)
git_mempack_new
(
git_odb_backend
**
out
);
/**
*
Dump all the queued in-memory writes to a packfile.
*
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).
*
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.
*
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).
*
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).
*
*
@param pack Buffer where to store the raw packfile
*
@param repo The active repository where the backend is loaded
*
@param backend The mempack backend
*
@return 0 on success; error code otherwise
*
@param pack Buffer where to store the raw packfile
*
@param repo The active repository where the backend is loaded
*
@param backend The mempack backend
*
@return 0 on success; error code otherwise
*/
GIT_EXTERN
(
int
)
git_mempack_dump
(
git_buf
*
pack
,
git_repository
*
repo
,
git_odb_backend
*
backend
);
/**
*
Reset the memory packer by clearing all the queued objects.
*
Reset the memory packer by clearing all the queued objects.
*
*
This assumes that `git_mempack_dump` has been called before to
*
store all the queued objects into a single packfile.
*
This assumes that `git_mempack_dump` has been called before to
*
store all the queued objects into a single packfile.
*
*
Alternatively, call `reset` without a previous dump to "undo"
*
all the recently written objects, giving transaction-like
*
semantics to the Git repository.
*
Alternatively, call `reset` without a previous dump to "undo"
*
all the recently written objects, giving transaction-like
*
semantics to the Git repository.
*
*
@param backend The mempack backend
*
@param backend The mempack backend
*/
GIT_EXTERN
(
void
)
git_mempack_reset
(
git_odb_backend
*
backend
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment