From 687d613a71b62ee2dc4b1cbb6c456646240a29f3 Mon Sep 17 00:00:00 2001 From: Philip Metzger Date: Wed, 24 Jul 2024 20:16:03 +0200 Subject: [PATCH] run: Treat `jj run -j0 ` as use all available cores Waleed noticed this is #3638. --- cli/src/commands/run.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/commands/run.rs b/cli/src/commands/run.rs index cbcab0296f1..6e9c94e429f 100644 --- a/cli/src/commands/run.rs +++ b/cli/src/commands/run.rs @@ -59,7 +59,7 @@ pub fn cmd_run(ui: &mut Ui, command: &CommandHelper, args: &RunArgs) -> Result<( // 2. the amount of cores available. // 3. a single job, if all of the above fails. let _jobs = match args.jobs { - Some(0) => return Err(user_error("must pass at least one job")), + Some(0) => std::thread::available_parallelism().map(|t| t.into()).ok(), Some(jobs) => Some(jobs), None => std::thread::available_parallelism().map(|t| t.into()).ok(), }