History

Remove all public exports of git-hash types in git-object (#63)

Sebastian Thiel committed 5 years ago

Commit accf89d1 parent a3f281660 files · +262 −252Browse files

Showing the changes to git-commitgraph/src/graph (2 of 60 files). Show all

Unified · Split

2 files
  1. git-commitgraph/src/graph/init.rs +2 −3
  2. git-commitgraph/src/graph/verify.rs +8 −5
git-commitgraph/src/graph/init.rs+2−3
@@ -2,7 +2,6 @@ use crate::{ · 1 unmodified line
2 file::{self, File},2 file::{self, File},
3 Graph, MAX_COMMITS,3 Graph, MAX_COMMITS,
4};4};
5use git_object::HashKind;
6use std::{5use std::{
7 convert::TryFrom,6 convert::TryFrom,
8 io::{BufRead, BufReader},7 io::{BufRead, BufReader},
@@ -22,9 +21,9 @@ pub enum Error { · 13 unmodified lines
22 #[error("Commit-graph files mismatch: '{}' uses hash {hash1:?}, but '{}' uses hash {hash2:?}", .path1.display(), .path2.display())]21 #[error("Commit-graph files mismatch: '{}' uses hash {hash1:?}, but '{}' uses hash {hash2:?}", .path1.display(), .path2.display())]
23 HashVersionMismatch {22 HashVersionMismatch {
24 path1: PathBuf,23 path1: PathBuf,
25 hash1: HashKind,24 hash1: git_hash::Kind,
26 path2: PathBuf,25 path2: PathBuf,
27 hash2: HashKind,26 hash2: git_hash::Kind,
28 },27 },
29 #[error("Did not find any files that look like commit graphs at '{}'", .0.display())]28 #[error("Did not find any files that look like commit graphs at '{}'", .0.display())]
30 InvalidPath(PathBuf),29 InvalidPath(PathBuf),
git-commitgraph/src/graph/verify.rs+8−5
@@ -3,7 +3,6 @@ use crate::{ · 2 unmodified lines
3 file::{self, commit},3 file::{self, commit},
4 graph, Graph, GENERATION_NUMBER_MAX,4 graph, Graph, GENERATION_NUMBER_MAX,
5};5};
6use git_object::owned;
7use std::{6use std::{
8 cmp::{max, min},7 cmp::{max, min},
9 collections::BTreeMap,8 collections::BTreeMap,
@@ -19,8 +18,8 @@ pub enum Error<E: std::error::Error + 'static> { · 9 unmodified lines
19 BaseGraphCount { actual: u8, expected: u8, path: PathBuf },18 BaseGraphCount { actual: u8, expected: u8, path: PathBuf },
20 #[error("'{}' base graph at index {index} should have ID {expected} but is {actual}", .path.display())]19 #[error("'{}' base graph at index {index} should have ID {expected} but is {actual}", .path.display())]
21 BaseGraphId {20 BaseGraphId {
22 actual: owned::Id,21 actual: git_hash::Id,
23 expected: owned::Id,22 expected: git_hash::Id,
24 index: u8,23 index: u8,
25 path: PathBuf,24 path: PathBuf,
26 },25 },
@@ -36,12 +35,16 @@ pub enum Error<E: std::error::Error + 'static> { · 9 unmodified lines
36 path: PathBuf,35 path: PathBuf,
37 },36 },
38 #[error("Commit {id}'s generation should be {expected} but is {actual}")]37 #[error("Commit {id}'s generation should be {expected} but is {actual}")]
39 Generation { actual: u32, expected: u32, id: owned::Id },38 Generation {
39 actual: u32,
40 expected: u32,
41 id: git_hash::Id,
42 },
40 #[error(43 #[error(
41 "Commit {id} has parent position {parent_pos} that is out of range (should be in range 0-{max_valid_pos})"44 "Commit {id} has parent position {parent_pos} that is out of range (should be in range 0-{max_valid_pos})"
42 )]45 )]
43 ParentOutOfRange {46 ParentOutOfRange {
44 id: owned::Id,47 id: git_hash::Id,
45 max_valid_pos: graph::Position,48 max_valid_pos: graph::Position,
46 parent_pos: graph::Position,49 parent_pos: graph::Position,
47 },50 },