This will let future code that writes commit graphs use those constants.
Showing the changes to git-commitgraph/src/file/commit.rs (1 of 3 files). Show all
Unified · Split
| @@ -9,7 +9,7 @@ use byteorder::{BigEndian, ByteOrder}; · 8 unmodified lines | ||
| 9 | 9 | use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE; |
| 10 | 10 | |
| 11 | 11 | use crate::{ |
| 12 | − file::{self, File}, | |
| 12 | + file::{self, File, EXTENDED_EDGES_MASK, LAST_EXTENDED_EDGE_MASK, NO_PARENT}, | |
| 13 | 13 | graph, |
| 14 | 14 | }; |
| 15 | 15 | |
| @@ -27,11 +27,6 @@ pub enum Error { · 11 unmodified lines | ||
| 27 | 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 . | |
| 32 | −const NO_PARENT: u32 = 0x7000_0000; | |
| 33 | −const EXTENDED_EDGES_MASK: u32 = 0x8000_0000; | |
| 34 | − | |
| 35 | 30 | /// A commit as stored in a [`File`]. |
| 36 | 31 | pub struct Commit<'a> { |
| 37 | 32 | file: &'a File, |
| @@ -240,8 +235,6 @@ impl ParentEdge { · 202 unmodified lines | ||
| 240 | 235 | } |
| 241 | 236 | } |
| 242 | 237 | |
| 243 | −const LAST_EXTENDED_EDGE_MASK: u32 = 0x8000_0000; | |
| 244 | − | |
| 245 | 238 | enum ExtraEdge { |
| 246 | 239 | Internal(graph::Position), |
| 247 | 240 | Last(graph::Position), |