Skip to content

Commit

Permalink
fix: fix check without --read-data (#299)
Browse files Browse the repository at this point in the history
Fixes a regression introduced by #262: Check without `--read-data`
throws lots of error because we changed the access to the index.
  • Loading branch information
aawsome authored Oct 3, 2024
1 parent d1a8036 commit e45a427
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions crates/core/src/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl CheckOptions {
}
}

let index_collector = check_packs(be, hot_be, self.read_data, pb)?;
let index_collector = check_packs(be, hot_be, pb)?;

if let Some(cache) = &cache {
let p = pb.progress_spinner("cleaning up packs from cache...");
Expand Down Expand Up @@ -363,16 +363,11 @@ fn check_cache_files(
fn check_packs(
be: &impl DecryptReadBackend,
hot_be: &Option<impl ReadBackend>,
read_data: bool,
pb: &impl ProgressBars,
) -> RusticResult<IndexCollector> {
let mut packs = HashMap::new();
let mut tree_packs = HashMap::new();
let mut index_collector = IndexCollector::new(if read_data {
IndexType::Full
} else {
IndexType::DataIds
});
let mut index_collector = IndexCollector::new(IndexType::Full);

let p = pb.progress_counter("reading index...");
for index in be.stream_all::<IndexFile>(&p)? {
Expand Down

0 comments on commit e45a427

Please sign in to comment.