Skip to content

Commit

Permalink
run: Treat jj run -j0 <command> as use all available cores
Browse files Browse the repository at this point in the history
Waleed noticed this in #4021.
  • Loading branch information
PhilipMetzger committed Jul 24, 2024
1 parent ef05604 commit fa7f4e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cli/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fa7f4e6

Please sign in to comment.