#[non_exhaustive]pub struct SubmoduleUpdate {
pub init: bool,
pub recursive: bool,
pub depth: Option<u32>,
pub paths: Vec<String>,
}Expand description
A git submodule update specification — checks out the submodules recorded
in the superproject’s index to the commits it pins, optionally initializing
(--init) and recursing (--recursive) first, and optionally scoped to
specific paths. Built fluently; see GitApi::submodule_update.
This is the one submodule verb that materializes and executes a different
(nested) repository’s content — with init, it clones/fetches each
submodule from the URL its .gitmodules records and checks out its working
tree. Treat those nested repos with the same untrusted-repo caution as the
superproject; see the submodules section of the security guide.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.init: boolInitialize (register + clone) submodules not yet set up (--init).
recursive: boolRecurse into nested submodules (--recursive).
depth: Option<u32>Create a shallow clone with this history depth (--depth <n>); None
leaves the depth unset (full history).
paths: Vec<String>Restrict the update to these repo-relative submodule paths; empty means
every submodule. Passed after a -- terminator so a path can never be
parsed as a flag.
Implementations§
Source§impl SubmoduleUpdate
impl SubmoduleUpdate
Sourcepub fn depth(self, depth: u32) -> Self
pub fn depth(self, depth: u32) -> Self
Make a shallow checkout with history depth (--depth <n>).
Sourcepub fn path(self, path: impl Into<String>) -> Self
pub fn path(self, path: impl Into<String>) -> Self
Scope the update to one submodule path (repeatable). With no path set,
the update covers every submodule.
Sourcepub fn paths(self, paths: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn paths(self, paths: impl IntoIterator<Item = impl Into<String>>) -> Self
Scope the update to several submodule paths (appended to any already set).
Trait Implementations§
Source§impl Clone for SubmoduleUpdate
impl Clone for SubmoduleUpdate
Source§fn clone(&self) -> SubmoduleUpdate
fn clone(&self) -> SubmoduleUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more