History

Promote file-format constants to `git_commitgraph::file` module.

This will let future code that writes commit graphs use those constants.

Conor Davis committed 5 years ago

Commit 0afd3541 parent b559dd03 files · +30 −28Browse files

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

Unified · Split

git-commitgraph/src/file/commit.rs+1−8
@@ -9,7 +9,7 @@ use byteorder::{BigEndian, ByteOrder}; · 8 unmodified lines
9use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE;9use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE;
10 10
11use crate::{11use crate::{
12 file::{self, File},12 file::{self, File, EXTENDED_EDGES_MASK, LAST_EXTENDED_EDGE_MASK, NO_PARENT},
13 graph,13 graph,
14};14};
15 15
@@ -27,11 +27,6 @@ pub enum Error { · 11 unmodified lines
27 SecondParentWithoutFirstParent(git_hash::ObjectId),27 SecondParentWithoutFirstParent(git_hash::ObjectId),
28}28}
29 29
30// Note that git's commit-graph-format.txt as of v2.28.0 gives an incorrect value 0x0700_0000 for
31// NO_PARENT. Fixed in https://github.com/git/git/commit/4d515253afcef985e94400adbfed7044959f9121 .
32const NO_PARENT: u32 = 0x7000_0000;
33const EXTENDED_EDGES_MASK: u32 = 0x8000_0000;
34
35/// A commit as stored in a [`File`].30/// A commit as stored in a [`File`].
36pub struct Commit<'a> {31pub struct Commit<'a> {
37 file: &'a File,32 file: &'a File,
@@ -240,8 +235,6 @@ impl ParentEdge { · 202 unmodified lines
240 }235 }
241}236}
242 237
243const LAST_EXTENDED_EDGE_MASK: u32 = 0x8000_0000;
244
245enum ExtraEdge {238enum ExtraEdge {
246 Internal(graph::Position),239 Internal(graph::Position),
247 Last(graph::Position),240 Last(graph::Position),