pub struct SparseCheckout { /* private fields */ }Expand description
Sparse checkout manager for git repositories.
Implementations§
Source§impl SparseCheckout
impl SparseCheckout
Sourcepub fn init(repo_path: impl AsRef<Path>) -> Result<Self>
pub fn init(repo_path: impl AsRef<Path>) -> Result<Self>
Initialize sparse checkout in an existing repository.
Sourcepub fn clone(url: &str, target: impl AsRef<Path>) -> Result<Self>
pub fn clone(url: &str, target: impl AsRef<Path>) -> Result<Self>
Clone a repository with sparse checkout enabled.
Sourcepub fn clone_shallow(
url: &str,
target: impl AsRef<Path>,
depth: u32,
) -> Result<Self>
pub fn clone_shallow( url: &str, target: impl AsRef<Path>, depth: u32, ) -> Result<Self>
Clone with depth limit for faster initial clone.
Sourcepub fn open(repo_path: impl AsRef<Path>) -> Result<Self>
pub fn open(repo_path: impl AsRef<Path>) -> Result<Self>
Open an existing sparse checkout repository.
Sourcepub fn remote_url(&self) -> Option<&str>
pub fn remote_url(&self) -> Option<&str>
Get the remote URL.
Sourcepub fn set_paths(&self, paths: &[&str]) -> Result<()>
pub fn set_paths(&self, paths: &[&str]) -> Result<()>
Set the sparse checkout paths (replaces existing).
Sourcepub fn add_filter(&self, filter: &SparseFilter) -> Result<()>
pub fn add_filter(&self, filter: &SparseFilter) -> Result<()>
Add a filter to the sparse checkout.
Sourcepub fn set_filters(&self, filters: &[SparseFilter]) -> Result<()>
pub fn set_filters(&self, filters: &[SparseFilter]) -> Result<()>
Set filters for the sparse checkout (replaces existing).
Sourcepub fn list_patterns(&self) -> Result<Vec<String>>
pub fn list_patterns(&self) -> Result<Vec<String>>
List current sparse checkout patterns.
Sourcepub fn checkout_ref(&self, reference: &str) -> Result<()>
pub fn checkout_ref(&self, reference: &str) -> Result<()>
Checkout a specific branch or tag.
Sourcepub fn status(&self) -> Result<SparseStatus>
pub fn status(&self) -> Result<SparseStatus>
Get status of sparse checkout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SparseCheckout
impl RefUnwindSafe for SparseCheckout
impl Send for SparseCheckout
impl Sync for SparseCheckout
impl Unpin for SparseCheckout
impl UnwindSafe for SparseCheckout
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more