Skip to content

Commit

Permalink
pass thread-limit along to checkout (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Mar 9, 2022
1 parent 07a4094 commit 07e9081
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gitoxide-core/src/index/checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub fn checkout_exclusive(
index: Options { object_hash, .. },
empty_files,
keep_going,
thread_limit,
}: index::checkout_exclusive::Options,
) -> anyhow::Result<()> {
let repo = repo
Expand Down Expand Up @@ -57,6 +58,7 @@ pub fn checkout_exclusive(
destination_is_initially_empty: true,
overwrite_existing: false,
keep_going,
thread_limit,
..Default::default()
};

Expand Down
4 changes: 4 additions & 0 deletions gitoxide-core/src/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ pub mod checkout_exclusive {
/// If true, all files will be written with zero bytes despite having made an ODB lookup.
pub empty_files: bool,
pub keep_going: bool,
/// If set, don't use more than this amount of threads.
/// Otherwise, usually use as many threads as there are logical cores.
/// A value of 0 is interpreted as no-limit
pub thread_limit: Option<usize>,
}
}

Expand Down
1 change: 1 addition & 0 deletions src/plumbing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pub fn main() -> Result<()> {
index: core::index::Options { object_hash, format },
empty_files,
keep_going,
thread_limit,
},
)
},
Expand Down

0 comments on commit 07e9081

Please sign in to comment.