History

[commitgraph] Remove `Kind` enum.

Commit-graph files only have one version for now, so no need to indicate file versions. Still return an error if attempting to parse a file that is not at version 1.

Conor Davis committed 6 years ago

Commit 3c927611 parent 36953e03 files · +1 −29Browse files

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

Unified · Split

3 files
  1. git-commitgraph/src/graph/init.rs +0 −18
  2. git-commitgraph/src/graph_file/access.rs +1 −5
  3. git-commitgraph/src/graph_file/mod.rs +0 −6
git-commitgraph/src/graph/init.rs+0−18
@@ -34,16 +34,6 @@ quick_error! { · 33 unmodified lines
3434 MAX_COMMITS,
3535 )
3636 }
37− // This might actually be legal...
38− VersionMismatch(path1: PathBuf, version1: graph_file::Kind, path2: PathBuf, version2: graph_file::Kind) {
39− display(
40− "Commit-graph files mismatch: '{}' is version {:?}, but '{}' is version {:?}",
41− path1.display(),
42− version1,
43− path2.display(),
44− version2,
45− )
46− }
4737 }
4838 }
4939
@@ -82,14 +72,6 @@ impl Graph { · 32 unmodified lines
8272 for window in files.windows(2) {
8373 let f1 = &window[0];
8474 let f2 = &window[1];
85− if f1.kind() != f2.kind() {
86− return Err(Error::VersionMismatch(
87− f1.path().to_owned(),
88− f1.kind(),
89− f2.path().to_owned(),
90− f2.kind(),
91− ));
92− }
9375 if f1.hash_kind() != f2.hash_kind() {
9476 return Err(Error::HashVersionMismatch(
9577 f1.path().to_owned(),
git-commitgraph/src/graph_file/access.rs+1−5
@@ -1,4 +1,4 @@
1−use crate::graph_file::{Kind, LexPosition, COMMIT_DATA_ENTRY_SIZE};
1+use crate::graph_file::{LexPosition, COMMIT_DATA_ENTRY_SIZE};
22 use crate::{CommitData, GraphFile};
33 use git_object::{borrowed, HashKind, SHA1_SIZE};
44 use std::convert::{TryFrom, TryInto};
@@ -57,10 +57,6 @@ impl GraphFile { · 52 unmodified lines
5757 (0..self.num_commits()).map(move |i| self.id_at(LexPosition(i)))
5858 }
5959
60− pub fn kind(&self) -> Kind {
61− Kind::V1
62− }
63−
6460 // copied from git-odb/src/pack/index/access.rs
6561 pub fn lookup(&self, id: borrowed::Id) -> Option<LexPosition> {
6662 let first_byte = id.first_byte() as usize;
git-commitgraph/src/graph_file/mod.rs+0−6
@@ -45,9 +45,3 @@ impl Display for LexPosition { · 44 unmodified lines
4545 self.0.fmt(f)
4646 }
4747 }
48−
49−/// The version of a commit graph file.
50−#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
51−pub enum Kind {
52− V1,
53−}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t