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
99 use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE;
1010
1111 use crate::{
12− file::{self, File},
12+ file::{self, File, EXTENDED_EDGES_MASK, LAST_EXTENDED_EDGE_MASK, NO_PARENT},
1313 graph,
1414 };
1515
@@ -27,11 +27,6 @@ pub enum Error { · 11 unmodified lines
2727 SecondParentWithoutFirstParent(git_hash::ObjectId),
2828 }
2929
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 .
32−const NO_PARENT: u32 = 0x7000_0000;
33−const EXTENDED_EDGES_MASK: u32 = 0x8000_0000;
34−
3530 /// A commit as stored in a [`File`].
3631 pub struct Commit<'a> {
3732 file: &'a File,
@@ -240,8 +235,6 @@ impl ParentEdge { · 202 unmodified lines
240235 }
241236 }
242237
243−const LAST_EXTENDED_EDGE_MASK: u32 = 0x8000_0000;
244−
245238 enum ExtraEdge {
246239 Internal(graph::Position),
247240 Last(graph::Position),