Expand description
GitBackend implementation over libgit2 (via the git2 crate).
Git2Backend is a decorator: per-operation it either calls into libgit2
directly or dispatches to an inner gitpoulpi_cli_backend::SystemGitBackend
for operations git2 doesn’t support well (see
docs/architecture/git-backend-trait.md for the capability matrix this
dispatch follows and which operations are currently Native vs.
CliFallback in this implementation).
Structs§
Functions§
- count_
commits_ in_ process - The commit total counted by an in-process libgit2 revwalk, whichever
backend the session runs (
log.commit_count = "libgit2"). Spawns no process, except for a path-filtered count (seereads::count_commits). - native_
index_ fingerprint - A fingerprint of what the index holds: every entry’s mode, blob id,
stage (so unmerged entries count) and path, hashed. Unlike the index
file’s checksum it does not change when a
git statusmerely refreshes the stat data. - native_
index_ tree - The tree of the index on disk, written to the object database, with no process. The undo journal calls it for every backend: a tree id is the same whoever computes it, and it keeps system-git staging at one process. Errors (conflicts, a split or sparse index libgit2 cannot read) are the caller’s cue to ask the backend instead.
- native_
path_ hashes - native_
ref_ snapshot GitBackend::ref_snapshotandstashesover libgit2 (the contract suite holds them identical to the system git’s): the journal reads them around every recorded operation, so serving them in process saves the system backend a spawn or two per read.- native_
snapshot_ create GitBackend::snapshot_create/path_hashesover libgit2, for the undo journal to use whichever backend serves the session (the contract suite holds the results identical): no process.- native_
stashes