pub struct Repo { /* private fields */ }Implementations§
Trait Implementations§
Source§impl AttributeSource for Repo
impl AttributeSource for Repo
Source§fn check_attr(
&self,
attr: &str,
paths: &[&[u8]],
) -> Result<Vec<AttrValue>, EngineError>
fn check_attr( &self, attr: &str, paths: &[&[u8]], ) -> Result<Vec<AttrValue>, EngineError>
Note, unchanged from before this trait existed:
check-attr consults
the worktree/index .gitattributes, not the reviewed revisions —
acceptable for a hint that can never remove a file from enumeration.Source§impl CommitHistory for Repo
impl CommitHistory for Repo
Source§fn has_commits(&self) -> bool
fn has_commits(&self) -> bool
False on an unborn HEAD — there is nothing to diff against.
Source§fn recent_commits(
&self,
from: &str,
max: usize,
) -> Result<Vec<CommitSummary>, EngineError>
fn recent_commits( &self, from: &str, max: usize, ) -> Result<Vec<CommitSummary>, EngineError>
The most recent
max commits reachable from from, newest first.Source§impl CommitWriter for Repo
impl CommitWriter for Repo
fn commit_tree( &self, tree: &str, parent: &str, message: &[u8], identity: CommitIdentity<'_>, ) -> Result<String, EngineError>
Source§impl DiffSource for Repo
impl DiffSource for Repo
Source§fn raw_records(&self, base: &str, head: &str) -> Result<Vec<u8>, EngineError>
fn raw_records(&self, base: &str, head: &str) -> Result<Vec<u8>, EngineError>
diff-tree -r -z --raw --full-index --no-renames: authoritative modes,
full oids, dispositions.Source§fn canonical_patch(
&self,
base: &str,
head: &str,
) -> Result<Vec<u8>, EngineError>
fn canonical_patch( &self, base: &str, head: &str, ) -> Result<Vec<u8>, EngineError>
diff-tree -r -U0 --no-renames --no-color --no-ext-diff: the canonical
patch. Every hunk in the system comes from here.Source§fn rename_records(&self, base: &str, head: &str) -> Result<Vec<u8>, EngineError>
fn rename_records(&self, base: &str, head: &str) -> Result<Vec<u8>, EngineError>
diff-tree -r -M -z --name-status: rename-detected annotations
only (ADR 0003). Never affects what exists.Source§impl ObjectReader for Repo
impl ObjectReader for Repo
Source§fn blobs(
&self,
specs: &[(&str, &[u8])],
) -> Result<Vec<Option<Vec<u8>>>, EngineError>
fn blobs( &self, specs: &[(&str, &[u8])], ) -> Result<Vec<Option<Vec<u8>>>, EngineError>
The same, for several specs at once, answered in the order given. Read more
Source§fn require_object(&self, oid: &str) -> Result<(), EngineError>
fn require_object(&self, oid: &str) -> Result<(), EngineError>
Assert
oid is present in the odb. Read moreSource§impl ObjectWriter for Repo
impl ObjectWriter for Repo
Source§fn write_blob(&self, content: &[u8]) -> Result<String, EngineError>
fn write_blob(&self, content: &[u8]) -> Result<String, EngineError>
Write
content as a blob and return its oid.Source§impl RangeResolver for Repo
impl RangeResolver for Repo
fn merge_base(&self, a: &str, b: &str) -> Result<String, EngineError>
Source§fn resolve_endpoint(&self, rev: &str) -> Result<String, EngineError>
fn resolve_endpoint(&self, rev: &str) -> Result<String, EngineError>
Resolve to a commit sha, or accept a raw tree oid. Read more
Source§impl RecountSource for Repo
impl RecountSource for Repo
Source§fn recount_patch(&self, from: &str, to: &str) -> Result<Vec<u8>, EngineError>
fn recount_patch(&self, from: &str, to: &str) -> Result<Vec<u8>, EngineError>
Spelled out here rather than delegating to canonical_patch, and the
argv genuinely differs from it (no --no-color --no-ext-diff). Both
facts are deliberate: invariant 4’s independence is the whole point, so
one edit to enumeration’s flags must not move both sides of the
comparison. Do not “tidy” these two into one.
Source§impl RefWriter for Repo
impl RefWriter for Repo
fn update_ref(&self, name: &str, target: &str) -> Result<(), EngineError>
Source§impl RepoLayout for Repo
impl RepoLayout for Repo
Source§fn common_dir(&self) -> Result<PathBuf, EngineError>
fn common_dir(&self) -> Result<PathBuf, EngineError>
The shared git directory, absolutised (worktree-safe).
fn work_root(&self) -> &Path
Source§impl TreeBuilder for Repo
impl TreeBuilder for Repo
Source§type Session = ScratchIndex
type Session = ScratchIndex
Not object-safe, by design: an associated type makes
Box<dyn TreeBuilder> impossible, so runtime dispatch cannot creep
back in behind this seam.Source§fn begin_from_tree(&self, tree_ish: &str) -> Result<ScratchIndex, EngineError>
fn begin_from_tree(&self, tree_ish: &str) -> Result<ScratchIndex, EngineError>
A scratch index seeded from
tree_ish.Source§fn begin_from_current_index(&self) -> Result<ScratchIndex, EngineError>
fn begin_from_current_index(&self) -> Result<ScratchIndex, EngineError>
A scratch index seeded from the repository’s CURRENT index, for the
ADR-0017 uncommitted-state snapshots. Read more
Source§impl WorkingCopy for Repo
impl WorkingCopy for Repo
Source§fn has_tracked_changes(&self) -> Result<bool, EngineError>
fn has_tracked_changes(&self) -> Result<bool, EngineError>
diff-index --quiet HEAD --: exit 1 means differences, which is the
answer rather than a failure — hence run_status instead of run.
Source§fn tracked_paths(&self) -> Result<Vec<u8>, EngineError>
fn tracked_paths(&self) -> Result<Vec<u8>, EngineError>
NUL-terminated tracked paths.
Source§fn untracked_paths(&self) -> Result<Vec<u8>, EngineError>
fn untracked_paths(&self) -> Result<Vec<u8>, EngineError>
NUL-terminated untracked-but-not-ignored paths.
Auto Trait Implementations§
impl Freeze for Repo
impl RefUnwindSafe for Repo
impl Send for Repo
impl Sync for Repo
impl Unpin for Repo
impl UnsafeUnpin for Repo
impl UnwindSafe for Repo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more