pub struct GitCheckout<'a> {
database: &'a GitDatabase,
path: PathBuf,
revision: Oid,
repo: Repository,
}Expand description
A local checkout of a particular revision from a GitDatabase.
Fields§
§database: &'a GitDatabaseThe git database where this checkout is cloned from.
path: PathBufPath to the root of the underlying Git repository on the local filesystem.
revision: OidThe git revision this checkout is for.
repo: RepositoryUnderlying Git repository instance for this checkout.
Implementations§
Source§impl<'a> GitCheckout<'a>
impl<'a> GitCheckout<'a>
Sourcefn new(
database: &'a GitDatabase,
revision: Oid,
repo: Repository,
) -> GitCheckout<'a>
fn new( database: &'a GitDatabase, revision: Oid, repo: Repository, ) -> GitCheckout<'a>
Creates an instance of GitCheckout. This doesn’t imply the checkout
is done. Use GitCheckout::is_fresh to check.
- The
databaseis where this checkout is from. - The
repowill be the checked out Git repository.
Sourcefn remote_url(&self) -> &Url
fn remote_url(&self) -> &Url
Gets the remote repository URL.
Sourcefn clone_into(
into: &Path,
database: &'a GitDatabase,
revision: Oid,
gctx: &GlobalContext,
) -> CargoResult<(GitCheckout<'a>, CheckoutGuard)>
fn clone_into( into: &Path, database: &'a GitDatabase, revision: Oid, gctx: &GlobalContext, ) -> CargoResult<(GitCheckout<'a>, CheckoutGuard)>
Clone a repo for a revision into a local path from a datatabase.
This is a filesystem-to-filesystem clone.
Sourcefn is_fresh(&self) -> bool
fn is_fresh(&self) -> bool
Checks if the HEAD of this checkout points to the expected revision.
Sourcefn reset(&self, gctx: &GlobalContext) -> CargoResult<CheckoutGuard>
fn reset(&self, gctx: &GlobalContext) -> CargoResult<CheckoutGuard>
Similar to reset(). This roughly performs git reset --hard to the
revision of this checkout, with additional interrupt protection by a
dummy file CHECKOUT_READY_LOCK.
If we’re interrupted while performing a git reset (e.g., we die
because of a signal) Cargo needs to be sure to try to check out this
repo again on the next go-round.
To enable this we have a dummy file in our checkout, .cargo-ok,
which if present means that the repo has been successfully reset and is
ready to go. Hence if we start to do a reset, we make sure this file
doesn’t exist. The caller of reset has an option to perform additional operations
(e.g. submodule update) before marking the check-out as ready.
Sourcefn update_submodules(&self, gctx: &GlobalContext) -> CargoResult<()>
fn update_submodules(&self, gctx: &GlobalContext) -> CargoResult<()>
Like git submodule update --recursive but for this git checkout.
This function respects submodule.<name>.update = none1 git config.
Submodules set to none won’t be fetched.
Auto Trait Implementations§
impl<'a> Freeze for GitCheckout<'a>
impl<'a> RefUnwindSafe for GitCheckout<'a>
impl<'a> !Send for GitCheckout<'a>
impl<'a> !Sync for GitCheckout<'a>
impl<'a> Unpin for GitCheckout<'a>
impl<'a> UnwindSafe for GitCheckout<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes