Expand description
Git plumbing for the lore store refs under refs/lore/*.
Every operation shells out to the user’s git binary (no libgit2) so it
inherits their authentication, SSH config, credential helpers, and remotes
for free. git is already a hard dependency of the project. This mirrors the
style of crate::git but uses plumbing commands (hash-object, mktree
via a temporary index, commit-tree, update-ref, cat-file, ls-tree)
so the store ref lives entirely outside refs/heads/* and never checks out
into the working tree.
All functions take an explicit repository path, run with that path as the
working directory, capture stderr, and return a SyncError::Git with the
command and stderr on failure.
Structs§
- Tree
Entry - A single entry in a ref’s tree.
Constants§
- ZERO_
OID - The all-zeros object id git uses to mean “this ref does not yet exist”.
Functions§
- add_
lore_ fetch_ refspec - Adds a tracking-namespace lore fetch refspec to a remote’s config (opt-in).
- build_
tree - Builds a new tree incrementally and returns its object SHA.
- commit_
tree - Creates a commit object for a tree and returns its SHA.
- fetch
- Fetches a lore ref from a remote into its remote-tracking ref.
- push
- Pushes a lore ref to a remote using an explicit refspec.
- read_
blob - Reads the bytes of a blob by its object SHA.
- read_
tracking_ tree - Reads the tree of a lore ref’s remote-tracking ref.
- read_
tree - Reads the full (recursive) tree of a ref as a list of blob entries.
- ref_
exists - Returns whether a ref exists in the repository.
- remote_
ref_ exists - Returns whether a remote advertises
ref_name, without fetching. - resolve_
ref - Resolves a ref to its commit SHA, or
Noneif the ref does not exist. - resolve_
tree - Resolves a ref to its tree SHA, or
Noneif the ref does not exist. - tracking_
ref_ name - Computes the remote-tracking ref name for a lore ref.
- update_
ref - Points a ref at a commit.
- update_
ref_ checked - Points a ref at a commit only if it currently holds the expected value.
- write_
blob - Writes raw bytes as a git blob and returns its object SHA.