Skip to content

Commit 07e9081

Browse files
committed
pass thread-limit along to checkout (#301)
1 parent 07a4094 commit 07e9081

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

gitoxide-core/src/index/checkout.rs

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub fn checkout_exclusive(
1717
index: Options { object_hash, .. },
1818
empty_files,
1919
keep_going,
20+
thread_limit,
2021
}: index::checkout_exclusive::Options,
2122
) -> anyhow::Result<()> {
2223
let repo = repo
@@ -57,6 +58,7 @@ pub fn checkout_exclusive(
5758
destination_is_initially_empty: true,
5859
overwrite_existing: false,
5960
keep_going,
61+
thread_limit,
6062
..Default::default()
6163
};
6264

gitoxide-core/src/index/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ pub mod checkout_exclusive {
2929
/// If true, all files will be written with zero bytes despite having made an ODB lookup.
3030
pub empty_files: bool,
3131
pub keep_going: bool,
32+
/// If set, don't use more than this amount of threads.
33+
/// Otherwise, usually use as many threads as there are logical cores.
34+
/// A value of 0 is interpreted as no-limit
35+
pub thread_limit: Option<usize>,
3236
}
3337
}
3438

src/plumbing/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ pub fn main() -> Result<()> {
102102
index: core::index::Options { object_hash, format },
103103
empty_files,
104104
keep_going,
105+
thread_limit,
105106
},
106107
)
107108
},

0 commit comments

Comments
 (0)