Skip to main content

Repo

Struct Repo 

Source
pub struct Repo { /* private fields */ }

Implementations§

Source§

impl Repo

Source

pub fn open(dir: &Path) -> Result<Self, EngineError>

Open the repository containing dir.

Source

pub fn root(&self) -> &Path

Trait Implementations§

Source§

impl Ancestry for Repo

Source§

fn commit_of(&self, spec: &str) -> Result<Option<String>, EngineError>

The commit a spec names NOW, or None if it names nothing. Read more
Source§

fn is_ancestor(&self, older: &str, newer: &str) -> Result<bool, EngineError>

Is older reachable from newer?
Source§

impl AttributeSource for Repo

Source§

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 Clone for Repo

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommitHistory for Repo

Source§

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>

The most recent max commits reachable from from, newest first.
Source§

fn refs_by_commit(&self) -> HashMap<String, Vec<String>>

Branch/tag/remote names by the COMMIT sha they point at, annotated tags peeled. Read more
Source§

impl CommitWriter for Repo

Source§

fn commit_tree( &self, tree: &str, parent: &str, message: &[u8], identity: CommitIdentity<'_>, ) -> Result<String, EngineError>

Source§

impl Debug for Repo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DiffSource for Repo

Source§

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>

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>

diff-tree -r -M -z --name-status: rename-detected annotations only (ADR 0003). Never affects what exists.
Source§

impl Fetcher for Repo

Source§

fn fetch(&self, remote: &str, refspecs: &[&str]) -> Result<(), EngineError>

git fetch <remote> <refspec>…, and nothing about what came back: the caller asks Ancestry::commit_of afterwards, as it did before.
Source§

impl ObjectReader for Repo

Source§

fn blob(&self, rev: &str, path: &[u8]) -> Result<Option<Vec<u8>>, EngineError>

Blob content at rev:path, with path kept as raw bytes. Read more
Source§

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>

Assert oid is present in the odb. Read more
Source§

impl ObjectWriter for Repo

Source§

fn write_blob(&self, content: &[u8]) -> Result<String, EngineError>

Write content as a blob and return its oid.
Source§

impl RangeResolver for Repo

Source§

fn merge_base(&self, a: &str, b: &str) -> Result<String, EngineError>

Source§

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

Source§

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

Source§

fn update_ref(&self, name: &str, target: &str) -> Result<(), EngineError>

Source§

impl RepoLayout for Repo

Source§

fn common_dir(&self) -> Result<PathBuf, EngineError>

The shared git directory, absolutised (worktree-safe).
Source§

impl TreeBuilder for Repo

Source§

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>

A scratch index seeded from tree_ish.
Source§

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 TreeResolver for Repo

Source§

impl WorkingCopy for Repo

Source§

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>

NUL-terminated tracked paths.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.