diff --git a/Cargo.lock b/Cargo.lock index 8f9b8a9909c..fc8032aff45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,35 +40,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5d78ce20460b82d3fa150275ed9d55e21064fc7951177baacf86a145c4a4b1f" -[[package]] -name = "argh" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f023c76cd7975f9969f8e29f0e461decbdc7f51048ce43427107a3d192f1c9bf" -dependencies = [ - "argh_derive", - "argh_shared", -] - -[[package]] -name = "argh_derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ad219abc0c06ca788aface2e3a1970587e3413ab70acd20e54b6ec524c1f8f" -dependencies = [ - "argh_shared", - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "argh_shared" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38de00daab4eac7d753e97697066238d67ce9d7e2d823ab4f72fe14af29f3f33" - [[package]] name = "arrayvec" version = "0.7.2" @@ -1865,7 +1836,6 @@ name = "gitoxide" version = "0.11.0" dependencies = [ "anyhow", - "argh", "atty", "clap 3.0.0-beta.5", "crosstermion", diff --git a/Cargo.toml b/Cargo.toml index 04c9c8909ab..2c3250a8c1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,6 @@ git-repository = { version ="^0.13.0", path = "git-repository", default-features git-transport-for-configuration-only = { package = "git-transport", optional = true, version ="^0.14.0", path = "git-transport" } clap = { version = "=3.0.0-beta.5", optional = true } -argh = { version = "0.1.5", optional = true, default-features = false } prodash = { version = "16.0.0", optional = true, default-features = false } atty = { version = "0.2.14", optional = true, default-features = false } env_logger = { version = "0.9.0", optional = true, default-features = false, features = ["humantime", "termcolor", "atty"] } diff --git a/Makefile b/Makefile index 24f290c0587..2f0e1ea7145 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ audit: ## run various auditing tools to assure we are legal and safe doc: ## Run cargo doc on all crates cargo doc - cargo doc --features=max,lean,light,small + cargo doc --features=max,lean,small clippy: ## Run cargo clippy on all crates cargo clippy --all --tests diff --git a/src/plumbing-cli.rs b/src/plumbing-cli.rs index 2a28df67012..15c1384e287 100644 --- a/src/plumbing-cli.rs +++ b/src/plumbing-cli.rs @@ -11,10 +11,5 @@ fn main() -> Result<()> { plumbing::pretty::main() } -#[cfg(all(feature = "lean-cli", not(feature = "pretty-cli")))] -fn main() -> Result<()> { - plumbing::lean::main() -} - -#[cfg(not(any(feature = "pretty-cli", feature = "lean-cli")))] -compile_error!("Please set 'lean-cli' or 'pretty-cli' feature flags"); +#[cfg(not(feature = "pretty-cli"))] +compile_error!("Please set 'pretty-cli' feature flag"); diff --git a/src/plumbing/lean/main.rs b/src/plumbing/lean/main.rs deleted file mode 100644 index e0b0328075e..00000000000 --- a/src/plumbing/lean/main.rs +++ /dev/null @@ -1,226 +0,0 @@ -use std::{ - io::{self, stderr, stdin, stdout}, - path::PathBuf, - sync::{ - atomic::{AtomicBool, Ordering}, - Arc, - }, -}; - -use anyhow::Result; -use git_features::progress::DoOrDiscard; -use gitoxide_core::{self as core, OutputFormat}; - -use crate::{ - plumbing::lean::options::{self, Args, SubCommands}, - shared::lean::prepare, -}; -#[cfg(all(feature = "gitoxide-core-blocking-client", feature = "gitoxide-core-async-client"))] -compile_error!("Please set only one of the client networking options."); - -pub fn main() -> Result<()> { - let cli: Args = crate::shared::from_env(); - let should_interrupt = Arc::new(AtomicBool::new(false)); - git_repository::interrupt::init_handler({ - let should_interrupt = Arc::clone(&should_interrupt); - move || should_interrupt.store(true, Ordering::SeqCst) - })?; - let thread_limit = cli.threads; - let verbose = cli.verbose; - match cli.subcommand { - SubCommands::PackCreate(options::PackCreate { - repository, - expansion, - nondeterministic_count, - statistics, - tips, - thin, - pack_cache_size_mb, - object_cache_size_mb, - output_directory, - }) => { - let (_handle, progress) = prepare(verbose, "pack-create", Some(core::pack::create::PROGRESS_RANGE)); - let has_tips = !tips.is_empty(); - let input = if has_tips { - None - } else { - #[cfg(feature = "atty")] - if atty::is(atty::Stream::Stdin) { - anyhow::bail!("Refusing to read from standard input as no path is given, but it's a terminal.") - } - Some(io::BufReader::new(stdin())) - }; - let expansion = expansion.unwrap_or_else(|| { - if has_tips { - core::pack::create::ObjectExpansion::TreeTraversal - } else { - core::pack::create::ObjectExpansion::None - } - }); - core::pack::create( - repository.unwrap_or_else(|| PathBuf::from(".")), - tips, - input, - output_directory, - DoOrDiscard::from(progress), - core::pack::create::Context { - expansion, - thin, - nondeterministic_count, - pack_cache_size_in_bytes: pack_cache_size_mb.unwrap_or(0) * 1_000_000, - object_cache_size_in_bytes: object_cache_size_mb.unwrap_or(0) * 1_000_000, - statistics: if statistics { Some(OutputFormat::Human) } else { None }, - out: stdout(), - thread_limit, - }, - ) - } - #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] - SubCommands::RemoteRefList(options::RemoteRefList { protocol, url }) => { - let (_handle, progress) = prepare(verbose, "remote-ref-list", Some(core::remote::refs::PROGRESS_RANGE)); - let res = core::remote::refs::list( - protocol, - &url, - DoOrDiscard::from(progress), - core::remote::refs::Context { - thread_limit, - format: OutputFormat::Human, - out: io::stdout(), - }, - ); - #[cfg(feature = "gitoxide-core-blocking-client")] - return res; - #[cfg(feature = "gitoxide-core-async-client")] - return futures_lite::future::block_on(res); - } - #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] - SubCommands::PackReceive(options::PackReceive { - protocol, - url, - directory, - refs, - refs_directory, - }) => { - let (_handle, progress) = prepare(verbose, "pack-receive", core::pack::receive::PROGRESS_RANGE); - let res = core::pack::receive( - protocol, - &url, - directory, - refs_directory, - refs.into_iter().map(|s| s.into()).collect(), - DoOrDiscard::from(progress), - core::pack::receive::Context { - thread_limit, - format: OutputFormat::Human, - out: io::stdout(), - should_interrupt, - }, - ); - #[cfg(feature = "gitoxide-core-blocking-client")] - return res; - #[cfg(feature = "gitoxide-core-async-client")] - return futures_lite::future::block_on(res); - } - SubCommands::IndexFromPack(options::IndexFromPack { - iteration_mode, - pack_path, - directory, - }) => { - use gitoxide_core::pack::index::PathOrRead; - let (_handle, progress) = prepare(verbose, "pack-explode", core::pack::index::PROGRESS_RANGE); - let input = if let Some(path) = pack_path { - PathOrRead::Path(path) - } else { - #[cfg(feature = "atty")] - if atty::is(atty::Stream::Stdin) { - anyhow::bail!("Refusing to read from standard input as no path is given, but it's a terminal.") - } - PathOrRead::Read(Box::new(std::io::stdin())) - }; - core::pack::index::from_pack( - input, - directory, - DoOrDiscard::from(progress), - core::pack::index::Context { - thread_limit, - iteration_mode: iteration_mode.unwrap_or_default(), - format: OutputFormat::Human, - out: io::stdout(), - should_interrupt: &git_repository::interrupt::IS_INTERRUPTED, - }, - ) - } - SubCommands::PackExplode(options::PackExplode { - pack_path, - sink_compress, - object_path, - verify, - check, - delete_pack, - }) => { - let (_handle, progress) = prepare(verbose, "pack-explode", None); - core::pack::explode::pack_or_pack_index( - pack_path, - object_path, - check.unwrap_or_default(), - progress, - core::pack::explode::Context { - thread_limit, - delete_pack, - sink_compress, - verify, - should_interrupt, - }, - ) - } - SubCommands::PackVerify(options::PackVerify { - path, - statistics, - algorithm, - decode, - re_encode, - }) => { - use self::core::pack::verify; - let (_handle, progress) = prepare(verbose, "pack-verify", None); - core::pack::verify::pack_or_pack_index( - path, - progress, - core::pack::verify::Context { - output_statistics: if statistics { - Some(core::OutputFormat::Human) - } else { - None - }, - algorithm: algorithm.unwrap_or(verify::Algorithm::LessTime), - thread_limit, - mode: match (decode, re_encode) { - (true, false) => verify::Mode::Sha1Crc32Decode, - (true, true) | (false, true) => verify::Mode::Sha1Crc32DecodeEncode, - (false, false) => verify::Mode::Sha1Crc32, - }, - out: stdout(), - err: stderr(), - should_interrupt, - }, - ) - .map(|_| ()) - } - SubCommands::CommitGraphVerify(options::CommitGraphVerify { path, statistics }) => { - use self::core::commitgraph::verify; - - verify::graph_or_file( - path, - verify::Context { - err: stderr(), - out: stdout(), - output_statistics: if statistics { - Some(core::OutputFormat::Human) - } else { - None - }, - }, - ) - .map(|_| ()) - } - } -} diff --git a/src/plumbing/lean/mod.rs b/src/plumbing/lean/mod.rs deleted file mode 100644 index 0359be5d05f..00000000000 --- a/src/plumbing/lean/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod main; -pub use main::main; -mod options; diff --git a/src/plumbing/lean/options.rs b/src/plumbing/lean/options.rs deleted file mode 100644 index 4288853c3f6..00000000000 --- a/src/plumbing/lean/options.rs +++ /dev/null @@ -1,279 +0,0 @@ -use std::{ffi::OsString, path::PathBuf}; - -use argh::FromArgs; -use gitoxide_core as core; - -#[derive(FromArgs)] -#[argh(name = "gix-plumbing")] -/// The lean git underworld -pub struct Args { - #[argh(switch)] - /// print the program version. - pub version: bool, - - /// display verbose messages and progress information - #[argh(switch, short = 'v')] - pub verbose: bool, - - #[argh(option, short = 't')] - /// the amount of threads to use for some operations. - /// - /// If unset, or the value is 0, there is no limit and all logical cores can be used. - pub threads: Option, - - #[argh(subcommand)] - pub subcommand: SubCommands, -} - -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand)] -pub enum SubCommands { - PackCreate(PackCreate), - PackVerify(PackVerify), - PackExplode(PackExplode), - IndexFromPack(IndexFromPack), - #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] - RemoteRefList(RemoteRefList), - #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] - PackReceive(PackReceive), - CommitGraphVerify(CommitGraphVerify), -} - -/// Create an index from a packfile. -/// -/// This command can also be used to stream packs to standard input or to repair partial packs. -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "pack-index-from-data")] -pub struct IndexFromPack { - /// specify how to iterate the pack, defaults to 'verify' - /// - /// Valid values are - /// - /// **as-is** do not do anything and expect the pack file to be valid as per the trailing hash, - /// **verify** the input ourselves and validate that it matches with the hash provided in the pack, - /// **restore** hash the input ourselves and ignore failing entries, instead finish the pack with the hash we computed - #[argh(option, short = 'i')] - pub iteration_mode: Option, - - /// path to the pack file to read (with .pack extension). - /// - /// If unset, the pack file is expected on stdin. - #[argh(option, short = 'p')] - pub pack_path: Option, - - /// the folder into which to place the pack and the generated index file - /// - /// If unset, only informational output will be provided to standard output. - #[argh(positional)] - pub directory: Option, -} - -/// List remote references from a remote identified by a url. -/// -/// This is the plumbing equivalent of `git ls-remote`. -/// Supported URLs are documented here: https://www.git-scm.com/docs/git-clone#_git_urls -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "remote-ref-list")] -#[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] -pub struct RemoteRefList { - /// the protocol version to use. Valid values are 1 and 2 - #[argh(option, short = 'p')] - pub protocol: Option, - - /// the URLs or path from which to receive references - /// - /// See here for a list of supported URLs: https://www.git-scm.com/docs/git-clone#_git_urls - #[argh(positional)] - pub url: String, -} - -/// Receive a pack from a remote identified by a url. -/// -/// This is the plumbing equivalent of `git clone` and `git-fetch`. -/// Supported URLs are documented here: https://www.git-scm.com/docs/git-clone#_git_urls -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "pack-receive")] -#[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] -pub struct PackReceive { - /// the protocol version to use. Valid values are 1 and 2 - #[argh(option, short = 'p')] - pub protocol: Option, - - /// the directory into which to write references. Existing files will be overwritten. - /// - /// Note that the directory will be created if needed. - #[argh(option, short = 'd')] - pub refs_directory: Option, - - /// the URLs or path from which to receive the pack. - /// - /// See here for a list of supported URLs: https://www.git-scm.com/docs/git-clone#_git_urls - #[argh(positional)] - pub url: String, - - /// if set once or more times, these references will be fetched instead of all advertised ones. - /// - /// Note that this requires a reasonably modern git server. - #[argh(option, long = "reference", short = 'r')] - pub refs: Vec, - - /// the directory into which to write the received pack and index. - /// - /// If unset, they will be discarded. - #[argh(positional)] - pub directory: Option, -} - -/// Explode a pack into loose objects. -/// -/// This can be useful in case of partially invalidated packs to extract as much information as possible, -/// or because working with loose objects is easier with custom tooling. -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "pack-explode")] -pub struct PackExplode { - #[argh(switch)] - /// read written objects back and assert they match their source. Fail the operation otherwise. - /// - /// Only relevant if an object directory is set. - pub verify: bool, - - /// delete the pack and index file after the operation is successful - #[argh(switch)] - pub delete_pack: bool, - - /// compress bytes even when using the sink, i.e. no object directory is specified - /// - /// This helps to determine overhead related to compression. If unset, the sink will - /// only create hashes from bytes, which is usually limited by the speed at which input - /// can be obtained. - #[argh(switch)] - pub sink_compress: bool, - - /// the amount of checks to run. Defaults to 'all'. - /// - /// Allowed values: - /// all - /// skip-file-checksum - /// skip-file-and-object-checksum - /// skip-file-and-object-checksum-and-no-abort-on-decode - #[argh(option, short = 'c')] - pub check: Option, - - /// the '.pack' or '.idx' file to explode into loose objects - #[argh(positional)] - pub pack_path: PathBuf, - - /// the path into which all objects should be written. Commonly '.git/objects' - #[argh(positional)] - pub object_path: Option, -} - -/// Verify a pack -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "pack-create")] -pub struct PackCreate { - #[argh(option, short = 'r')] - /// the directory containing the '.git' repository from which objects should be read. - pub repository: Option, - - #[argh(option, short = 'e')] - /// the way objects are expanded. They differ in costs. - /// - /// Possible values are "none" and "tree-traversal". Default is "none". - pub expansion: Option, - - #[argh(switch)] - /// if set, the counting phase may be accelerated using multithreading. - /// - /// On the flip side, however, one will loose deterministic counting results which affects the - /// way the resulting pack is structured. - pub nondeterministic_count: bool, - - #[argh(switch, short = 's')] - /// if set statistical information will be presented to inform about pack creation details. - /// It's a form of instrumentation for developers to help improve pack generation. - pub statistics: bool, - - #[argh(option)] - /// the size in megabytes for a cache to speed up pack access for packs with long delta chains. - /// It is shared among all threads, so 4 threads would use their own cache 1/4th of the size. - /// - /// If unset, no cache will be used. - pub pack_cache_size_mb: Option, - - #[argh(option)] - /// the size in megabytes for a cache to speed up accessing entire objects, bypassing object database access when hit. - /// It is shared among all threads, so 4 threads would use their own cache 1/4th of the size. - /// - /// This cache type is currently only effective when using the 'diff-tree' object expansion. - /// - /// If unset, no cache will be used. - pub object_cache_size_mb: Option, - - #[argh(switch)] - /// if set, delta-objects whose base object wouldn't be in the pack will not be recompressed as base object, but instead - /// refer to its base object using its object id. - /// - /// This allows for smaller packs but requires the receiver of the pack to resolve these ids before storing the pack. - /// Packs produced with this option enabled are only valid in transit, but not at rest. - pub thin: bool, - - /// the directory into which to write the pack file. - #[argh(option, short = 'o')] - pub output_directory: Option, - - /// the tips from which to start the commit graph iteration, either as fully qualified commit hashes - /// or as branch names. - /// - /// If empty, we expect to read objects on stdin and default to 'none' as expansion mode. - /// Otherwise the expansion mode is 'tree-traversal' by default. - #[argh(positional)] - pub tips: Vec, -} - -/// Verify a pack -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "pack-verify")] -pub struct PackVerify { - #[argh(switch)] - /// decode and parse tags, commits and trees to validate their correctness beyond hashing correctly. - /// - /// Malformed objects should not usually occur, but could be injected on purpose or accident. - /// This will reduce overall performance. - pub decode: bool, - - #[argh(switch)] - /// decode and parse tags, commits and trees to validate their correctness, and re-encode them. - /// - /// This flag is primarily to test the implementation of encoding, and requires to decode the object first. - /// Encoding an object after decoding it should yield exactly the same bytes. - /// This will reduce overall performance even more, as re-encoding requires to transform zero-copy objects into - /// owned objects, causing plenty of allocation to occour. - pub re_encode: bool, - - #[argh(option)] - /// the algorithm used to verify the pack. They differ in costs. - /// - /// Possible values are "less-time" and "less-memory". Default is "less-memory". - pub algorithm: Option, - - /// output statistical information about the pack - #[argh(switch, short = 's')] - pub statistics: bool, - /// the '.pack' or '.idx' file whose checksum to validate. - #[argh(positional)] - pub path: PathBuf, -} - -/// Verify a commit graph -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "commit-graph-verify")] -pub struct CommitGraphVerify { - /// the path to '.git/objects/info/', '.git/objects/info/commit-graphs/', or '.git/objects/info/commit-graph' to validate. - #[argh(positional)] - pub path: PathBuf, - - /// output statistical information about the pack - #[argh(switch, short = 's')] - pub statistics: bool, -} diff --git a/src/plumbing/mod.rs b/src/plumbing/mod.rs index 86c6d20d2d3..a35c6b86a4b 100644 --- a/src/plumbing/mod.rs +++ b/src/plumbing/mod.rs @@ -1,5 +1,2 @@ #[cfg(feature = "pretty-cli")] pub mod pretty; - -#[cfg(all(feature = "lean-cli", not(feature = "pretty-cli")))] -pub mod lean; diff --git a/src/plumbing/pretty/main.rs b/src/plumbing/pretty/main.rs index 093c12b1419..dc994c26784 100644 --- a/src/plumbing/pretty/main.rs +++ b/src/plumbing/pretty/main.rs @@ -95,7 +95,33 @@ pub fn main() -> Result<()> { }, ) } - #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] + #[cfg(feature = "gitoxide-core-async-client")] + Subcommands::PackReceive { + protocol, + url, + directory, + refs, + refs_directory, + } => { + let (_handle, progress) = + crate::shared::async_util::prepare(verbose, "pack-receive", core::pack::receive::PROGRESS_RANGE); + let fut = core::pack::receive( + protocol, + &url, + directory, + refs_directory, + refs.into_iter().map(|s| s.into()).collect(), + git_features::progress::DoOrDiscard::from(progress), + core::pack::receive::Context { + thread_limit, + format, + out: std::io::stdout(), + should_interrupt, + }, + ); + return futures_lite::future::block_on(fut); + } + #[cfg(feature = "gitoxide-core-blocking-client")] Subcommands::PackReceive { protocol, url, @@ -125,7 +151,26 @@ pub fn main() -> Result<()> { ) }, ), - #[cfg(any(feature = "gitoxide-core-async-client", feature = "gitoxide-core-blocking-client"))] + #[cfg(feature = "gitoxide-core-async-client")] + Subcommands::RemoteRefList { protocol, url } => { + let (_handle, progress) = crate::shared::async_util::prepare( + verbose, + "remote-ref-list", + Some(core::remote::refs::PROGRESS_RANGE), + ); + let fut = core::remote::refs::list( + protocol, + &url, + git_features::progress::DoOrDiscard::from(progress), + core::remote::refs::Context { + thread_limit, + format, + out: std::io::stdout(), + }, + ); + return futures_lite::future::block_on(fut); + } + #[cfg(feature = "gitoxide-core-blocking-client")] Subcommands::RemoteRefList { protocol, url } => prepare_and_run( "remote-ref-list", verbose, diff --git a/src/porcelain-cli.rs b/src/porcelain-cli.rs index b3446bb2ddd..22c11e9b792 100644 --- a/src/porcelain-cli.rs +++ b/src/porcelain-cli.rs @@ -1,20 +1,14 @@ #![forbid(unsafe_code)] #![deny(rust_2018_idioms)] -#[cfg(all(not(feature = "lean-cli"), feature = "pretty-cli"))] mod porcelain; -#[cfg(all(not(feature = "lean-cli"), feature = "pretty-cli"))] mod shared; use anyhow::Result; -#[cfg(all(not(feature = "lean-cli"), feature = "pretty-cli"))] fn main() -> Result<()> { porcelain::main() } -#[cfg(feature = "lean-cli")] -fn main() -> Result<()> { - eprintln!("There is no lean version of the porcelain CLI. Please build with the 'pretty-cli' feature flag."); - Ok(()) -} +#[cfg(not(feature = "pretty-cli"))] +compile_error!("Please set 'pretty-cli' feature flag"); diff --git a/src/shared.rs b/src/shared.rs index 93429d38d83..75d070d8ca5 100644 --- a/src/shared.rs +++ b/src/shared.rs @@ -39,27 +39,18 @@ impl LogCreator { } } -#[cfg(not(feature = "prodash-render-line"))] +#[cfg(not(any(feature = "prodash-render-tui", feature = "prodash-render-line")))] fn progress_tree() -> LogCreator { LogCreator } -#[cfg(all(feature = "lean-cli", not(feature = "pretty-cli")))] -pub mod lean { +#[cfg(feature = "gitoxide-core-async-client")] +pub mod async_util { use crate::shared::ProgressRange; #[cfg(not(feature = "prodash-render-line"))] - #[allow(unused)] - pub fn prepare( - verbose: bool, - name: &str, - _: impl Into>, - ) -> ((), Option) { - super::init_env_logger(verbose); - ((), Some(prodash::progress::Log::new(name, Some(1)))) - } + compile_error!("BUG: Need at least a line renderer in async mode"); - #[cfg(feature = "prodash-render-line")] pub fn prepare( verbose: bool, name: &str, diff --git a/tests/journey/gix.sh b/tests/journey/gix.sh index 75cd357b543..c34aff7b713 100644 --- a/tests/journey/gix.sh +++ b/tests/journey/gix.sh @@ -187,7 +187,7 @@ title "gix pack-receive" elif [[ "$kind" = "small" ]]; then it "fails as the CLI doesn't have networking in 'small' mode" && { WITH_SNAPSHOT="$snapshot/pack-receive-no-networking-in-small-failure" \ - expect_run $WITH_FAILURE "$exe_plumbing" pack-receive -p 1 .git + expect_run 2 "$exe_plumbing" pack-receive -p 1 .git } fi ) @@ -266,7 +266,7 @@ title "gix remote-ref-list" else it "fails as the CLI doesn't include networking in 'small' mode" && { WITH_SNAPSHOT="$snapshot/remote-ref-list-no-networking-in-small-failure" \ - expect_run $WITH_FAILURE "$exe_plumbing" remote-ref-list -p 1 .git + expect_run 2 "$exe_plumbing" remote-ref-list -p 1 .git } fi ) diff --git a/tests/snapshots/plumbing/pack-receive/pack-receive-no-networking-in-small-failure b/tests/snapshots/plumbing/pack-receive/pack-receive-no-networking-in-small-failure index 74d6602a909..8e24ad9262a 100644 --- a/tests/snapshots/plumbing/pack-receive/pack-receive-no-networking-in-small-failure +++ b/tests/snapshots/plumbing/pack-receive/pack-receive-no-networking-in-small-failure @@ -1 +1,10 @@ -Unrecognized argument: pack-receive \ No newline at end of file +error: The subcommand 'pack-receive' wasn't recognized + + Did you mean 'pack-index-from-data' or 'pack-explode' or 'pack-verify' or 'pack-create'? + +If you believe you received this message in error, try re-running with 'gix -- pack-receive' + +USAGE: + gix [OPTIONS] + +For more information try --help \ No newline at end of file diff --git a/tests/snapshots/plumbing/remote-ref-list/remote-ref-list-no-networking-in-small-failure b/tests/snapshots/plumbing/remote-ref-list/remote-ref-list-no-networking-in-small-failure index aaf27b70548..4ae50ee8b5b 100644 --- a/tests/snapshots/plumbing/remote-ref-list/remote-ref-list-no-networking-in-small-failure +++ b/tests/snapshots/plumbing/remote-ref-list/remote-ref-list-no-networking-in-small-failure @@ -1 +1,6 @@ -Unrecognized argument: remote-ref-list \ No newline at end of file +error: Found argument 'remote-ref-list' which wasn't expected, or isn't valid in this context + +USAGE: + gix [OPTIONS] + +For more information try --help \ No newline at end of file