diff --git a/.cargo/audit.toml b/.cargo/audit.toml new file mode 100644 index 0000000..9282233 --- /dev/null +++ b/.cargo/audit.toml @@ -0,0 +1,2 @@ +[advisories] +ignore = ["RUSTSEC-2024-0364"] diff --git a/src/commands.rs b/src/commands.rs index 43dae7b..3f8ead9 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -121,7 +121,6 @@ pub enum Commands { #[arg(short = 's', long = "shallow", default_value = "false", action = clap::ArgAction::SetTrue, default_missing_value = "true", help = "If given, sets the submodule as a shallow clone. It will only fetch the last commit of the branch, not the full history.")] shallow: bool, - // TODO: Implement this arg #[arg(long = "no-init", default_value = "false", action = clap::ArgAction::SetTrue, default_missing_value = "true", help = "If given, we'll add the submodule to your submod.toml but not initialize it.")] no_init: bool, }, diff --git a/src/git_manager.rs b/src/git_manager.rs index 70ee139..1ce0b2d 100644 --- a/src/git_manager.rs +++ b/src/git_manager.rs @@ -405,7 +405,7 @@ impl GitManager { sparse_paths: Option>, branch: Option, ignore: Option, - fetch: Option, + fetch_recurse: Option, update: Option, shallow: Option, no_init: bool, @@ -419,9 +419,9 @@ impl GitManager { branch: branch.clone(), ignore: ignore.clone(), update: update.clone(), - fetch_recurse: fetch.clone(), + fetch_recurse: fetch_recurse.clone(), active: Some(true), - shallow: shallow, + shallow, no_init: Some(no_init), sparse_paths: None, }, @@ -441,9 +441,9 @@ impl GitManager { branch: branch.clone(), ignore: ignore.clone(), update: update.clone(), - fetch_recurse: fetch.clone(), + fetch_recurse: fetch_recurse.clone(), shallow: shallow.unwrap_or(false), - no_init: false, + no_init, }; match self.git_ops.add_submodule(&opts).map_err(Self::map_git_ops_error) { Ok(()) => { @@ -454,12 +454,12 @@ impl GitManager { SubmoduleEntry { path: Some(path), url: Some(url), - branch: branch, - ignore: ignore, - update: update, - fetch_recurse: fetch, + branch, + ignore, + update, + fetch_recurse, active: Some(true), - shallow: shallow, + shallow, no_init: Some(no_init), sparse_paths: None, // stored separately via configure_submodule_post_creation },