forked from mirrors/jj
run: Treat jj run -j0 <command>
as use all available cores
Waleed noticed this in #4021.
This commit is contained in:
parent
ef0560413d
commit
fa7f4e68c5
1 changed files with 1 additions and 2 deletions
|
@ -59,9 +59,8 @@ 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) | None => std::thread::available_parallelism().map(|t| t.into()).ok(),
|
||||
Some(jobs) => Some(jobs),
|
||||
None => std::thread::available_parallelism().map(|t| t.into()).ok(),
|
||||
}
|
||||
// Fallback to a single user-visible job.
|
||||
.unwrap_or(1usize);
|
||||
|
|
Loading…
Reference in a new issue