1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const HEADER_READ_UNCOMPRESSED_BYTES: usize = 512;
use std::path::PathBuf;
pub struct Store {
pub path: PathBuf,
}
impl Store {
pub fn at(objects_directory: impl Into<PathBuf>) -> Store {
Store {
path: objects_directory.into(),
}
}
}
fn sha1_path(id: &git_hash::oid, mut root: PathBuf) -> PathBuf {
match id.kind() {
git_hash::Kind::Sha1 => {
let hex = id.to_sha1_hex();
let buf = std::str::from_utf8(&hex).expect("ascii only in hex");
root.push(&buf[..2]);
root.push(&buf[2..]);
root
}
}
}
pub mod find;
pub mod iter;
#[doc(inline)]
pub use iter::Iter;
pub mod write;