File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,17 @@ pub struct Options {
4545 pub min_extension_block_in_bytes_for_threading : usize ,
4646}
4747
48+ impl Options {
49+ /// Produce a reasonable default set of options knowing only the kind of object hash to expect.
50+ pub fn default_from_object_hash ( object_hash : git_hash:: Kind ) -> Self {
51+ Options {
52+ object_hash,
53+ thread_limit : None ,
54+ min_extension_block_in_bytes_for_threading : 0 ,
55+ }
56+ }
57+ }
58+
4859impl State {
4960 /// Decode an index state from `data` and store `timestamp` in the resulting instance for pass-through.
5061 pub fn from_bytes (
Original file line number Diff line number Diff line change @@ -23,11 +23,7 @@ fn size_of_entry() {
2323}
2424
2525pub fn decode_options ( ) -> git_index:: decode:: Options {
26- git_index:: decode:: Options {
27- object_hash : git_hash:: Kind :: Sha1 ,
28- thread_limit : None ,
29- min_extension_block_in_bytes_for_threading : 0 ,
30- }
26+ git_index:: decode:: Options :: default_from_object_hash ( git_hash:: Kind :: Sha1 )
3127}
3228
3329enum Fixture {
You can’t perform that action at this time.
0 commit comments