Skip to content

Commit d3b9740

Browse files
committed
fix: Repository::object_cache_size() now unsets the cache if Some(0) is passed.
Previously it would fail.
1 parent 35415c5 commit d3b9740

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gix/src/repository/cache.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ impl crate::Repository {
1111
pub fn object_cache_size(&mut self, bytes: impl Into<Option<usize>>) {
1212
let bytes = bytes.into();
1313
match bytes {
14+
Some(bytes) if bytes == 0 => self.objects.unset_object_cache(),
1415
Some(bytes) => self
1516
.objects
1617
.set_object_cache(move || Box::new(crate::object::cache::MemoryCappedHashmap::new(bytes))),

0 commit comments

Comments
 (0)