Skip to content

Commit

Permalink
hookup new indexing step
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jul 20, 2020
1 parent e0b34eb commit 313064f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
13 changes: 9 additions & 4 deletions git-odb/src/pack/index/verify/indexed.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
use super::{Error, Mode, Outcome};
use crate::{pack, pack::index};
use git_features::progress::{self, Progress};
use std::{fs, io};

impl index::File {
pub(crate) fn inner_verify_with_indexed_lookup<P, C>(
&self,
thread_limit: Option<usize>,
mode: Mode,
make_cache: impl Fn() -> C + Send + Sync,
mut root: progress::DoOrDiscard<P>,
_thread_limit: Option<usize>,
_mode: Mode,
_make_cache: impl Fn() -> C + Send + Sync,
mut progress: progress::DoOrDiscard<P>,
pack: &pack::data::File,
) -> Result<Outcome, Error>
where
P: Progress,
<P as Progress>::SubProgress: Send,
C: pack::cache::DecodeEntry,
{
let indexing_progress = progress.add_child("indexing");
let r =
io::BufReader::new(fs::File::open(pack.path()).map_err(|err| Error::Io(err, pack.path().into(), "open"))?);
pack::graph::DeltaTree::from_sorted_offsets(self.sorted_offsets().into_iter(), r, indexing_progress)?;
unimplemented!()
}
}
8 changes: 8 additions & 0 deletions git-odb/src/pack/index/verify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ use std::{collections::BTreeMap, time::Instant};
quick_error! {
#[derive(Debug)]
pub enum Error {
Io(err: std::io::Error, path: std::path::PathBuf, msg: &'static str) {
display("Failed to {} at path '{}'", msg, path.display())
source(err)
}
Graph(err: pack::graph::Error) {
from()
source(err)
}
Mismatch { expected: owned::Id, actual: owned::Id } {
display("index checksum mismatch: expected {}, got {}", expected, actual)
}
Expand Down

0 comments on commit 313064f

Please sign in to comment.