History

[commitgraph] refactor file::init

Sebastian Thiel committed 6 years ago

Commit 8b003a01 parent c4b14c12 files · +7 −4Browse files

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

Unified · Split

git-commitgraph/src/file/init.rs+5−4
@@ -136,7 +136,7 @@ impl TryFrom<&Path> for File { · 135 unmodified lines
136136 let mut base_graphs_list_offset: Option<usize> = None;
137137 let mut commit_data_offset: Option<usize> = None;
138138 let mut commit_data_count = 0u32;
139− let mut extended_edges_list_range: Option<Range<usize>> = None;
139+ let mut extra_edges_list_range: Option<Range<usize>> = None;
140140 let mut fan_offset: Option<usize> = None;
141141 let mut oid_lookup_offset: Option<usize> = None;
142142 let mut oid_lookup_count = 0u32;
@@ -208,11 +208,11 @@ impl TryFrom<&Path> for File { · 65 unmodified lines
208208 commit_data_count = (chunk_size / COMMIT_DATA_ENTRY_SIZE) as u32;
209209 }
210210 EXTENDED_EDGES_LIST_CHUNK_ID => {
211− if extended_edges_list_range.is_some() {
211+ if extra_edges_list_range.is_some() {
212212 return Err(Error::DuplicateChunk(chunk_id));
213213 }
214214
215− extended_edges_list_range = Some(Range {
215+ extra_edges_list_range = Some(Range {
216216 start: chunk_offset,
217217 end: next_chunk_offset,
218218 })
@@ -245,6 +245,7 @@ impl TryFrom<&Path> for File { · 26 unmodified lines
245245 }
246246 oid_lookup_offset = Some(chunk_offset);
247247 oid_lookup_count = (chunk_size / OID_LOOKUP_ENTRY_SIZE) as u32;
248+ // TODO(ST): Figure out how to handle this. Don't know what to do with the commented code.
248249 // git allows extra garbage in the extra edges list chunk?
249250 // if oid_lookup_count > 0 {
250251 // let last_edge = &data[next_chunk_offset - 4..next_chunk_offset];
@@ -296,7 +297,7 @@ impl TryFrom<&Path> for File { · 45 unmodified lines
296297 base_graphs_list_offset,
297298 commit_data_offset,
298299 data,
299− extra_edges_list_range: extended_edges_list_range,
300+ extra_edges_list_range,
300301 fan,
301302 oid_lookup_offset,
302303 path: path.to_owned(),