Skip to main content

Repository

Struct Repository 

Source
pub(crate) struct Repository {
    git: Repository,
}

Fields§

§git: Repository

Implementations§

Source§

impl Repository

Source

pub(crate) fn open(root: &Path) -> Result<Self, FilesError>

Source

fn stat( root: &Path, path: &RepositoryPath, ) -> Result<Option<(PathBuf, Metadata)>, FilesError>

The full path and metadata of path below root, or None when nothing exists there. A symlink in a parent directory is an error.

Source

pub(crate) fn current_entry( root: &Path, path: &RepositoryPath, ) -> Result<Option<FileEntry>, FilesError>

Source

pub(crate) fn tracked(&self) -> Result<BTreeSet<RepositoryPath>, FilesError>

Paths tracked in the index.

Untracked files are never discovered.

Source

pub(crate) fn leading_bytes( root: &Path, path: &RepositoryPath, ) -> Result<Option<Vec<u8>>, FilesError>

The first bytes of the file at path, empty for anything that is not a regular file, or None when nothing exists there.

Source

pub(crate) fn visible_files( &self, ) -> Result<BTreeSet<RepositoryPath>, FilesError>

Regular files that are tracked or untracked and not ignored.

Source

pub(crate) fn stage(&self, operations: &[Operation]) -> Result<(), FilesError>

Source

pub(crate) fn ensure_recoverable( &self, path: &RepositoryPath, current: &FileEntry, ) -> Result<(), FilesError>

Source

pub(crate) fn is_recoverable( &self, path: &RepositoryPath, current: &FileEntry, ) -> bool

Source

fn decode_path(bytes: &[u8]) -> Result<RepositoryPath, PathError>

Decode a Git-reported path, rejecting non-UTF-8 bytes the same way RepositoryPath::try_from rejects a structurally invalid path.

Auto Trait Implementations§

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> 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, 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, <T as TryFrom<U>>::Error>

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.