Skip to main content

CheckoutArgs

Struct CheckoutArgs 

Source
pub struct CheckoutArgs {
    pub base: bool,
    pub ours: bool,
    pub theirs: bool,
    pub to: Option<String>,
    pub paths: Vec<String>,
}
Expand description

Populate working copy with real content from Git LFS files.

Try to ensure that the working copy contains file content for Git LFS objects for the current ref, if the object data is available. Does not download any content; see git-lfs-fetch(1) for that.

Checkout scans the current ref for all LFS objects that would be required, then where a file is either missing in the working copy, or contains placeholder pointer content with the same SHA, the real file content is written, provided we have it in the local store. Modified files are never overwritten.

One or more may be provided as arguments to restrict the set of files that are updated. Glob patterns are matched as per the format described in gitignore(5).

When used with --to and the working tree is in a conflicted state due to a merge, this option checks out one of the three stages a conflicting Git LFS object into a separate file (which can be outside of the work tree). This can make using diff tools to inspect and resolve merges easier. A single Git LFS object’s file path must be provided in PATHS. If FILE already exists, whether as a regular file, symbolic link, or directory, it will be removed and replaced, unless it is a non-empty directory or otherwise cannot be deleted.

If the installed Git version is at least 2.42.0, this command will by default check out Git LFS objects for files only if they are present in the Git index and if they match a Git LFS filter attribute from a .gitattributes file that is present in either the index or the current working tree (or, as is always the case, if they match a Git LFS filter attribute in a local gitattributes file such as $GIT_DIR/info/attributes). These constraints do not apply with prior versions of Git.

In a repository with a partial clone or sparse checkout, it is therefore advisable to check out all .gitattributes files from HEAD before using this command, if Git v2.42.0 or later is installed. Alternatively, the GIT_ATTR_SOURCE environment variable may be set to HEAD, which will cause Git to only read attributes from .gitattributes files in HEAD and ignore those in the index or working tree.

In a bare repository, this command prints an informational message and exits without modifying anything. In a future version, it may exit with an error.

Fields§

§base: bool

Check out the merge base of the specified file

§ours: bool

Check out our side (that of the current branch) of the conflict for the specified file

§theirs: bool

Check out their side (that of the other branch) of the conflict for the specified file

§to: Option<String>

If the working tree is in a conflicted state, check out the portion of the conflict specified by --base, --ours, or --theirs to the given path. Exactly one of these options is required.

§paths: Vec<String>

Paths to check out.

When empty, everything in HEAD’s tree is checked out. In conflict mode (--to <path> together with one of --base, --ours, or --theirs), exactly one path is required.

Trait Implementations§

Source§

impl Args for CheckoutArgs

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl FromArgMatches for CheckoutArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

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 = Infallible

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.