Skip to main content

Crate gitpoulpi_git2_backend

Crate gitpoulpi_git2_backend 

Source
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§

Git2Backend

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 (see reads::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 status merely 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_snapshot and stashes over 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_hashes over libgit2, for the undo journal to use whichever backend serves the session (the contract suite holds the results identical): no process.
native_stashes