diff --git a/lib/src/default_index/mutable.rs b/lib/src/default_index/mutable.rs index 0b877e02b1..218a487315 100644 --- a/lib/src/default_index/mutable.rs +++ b/lib/src/default_index/mutable.rs @@ -72,8 +72,8 @@ impl MutableIndexSegment { pub(super) fn incremental(parent_file: Arc) -> Self { let num_parent_commits = parent_file.as_composite().num_commits(); - let commit_id_length = parent_file.commit_id_length; - let change_id_length = parent_file.change_id_length; + let commit_id_length = parent_file.commit_id_length(); + let change_id_length = parent_file.change_id_length(); Self { parent_file: Some(parent_file), num_parent_commits, diff --git a/lib/src/default_index/readonly.rs b/lib/src/default_index/readonly.rs index 0dd3a66946..1b04bb457c 100644 --- a/lib/src/default_index/readonly.rs +++ b/lib/src/default_index/readonly.rs @@ -126,8 +126,8 @@ pub(super) struct ReadonlyIndexSegment { parent_file: Option>, num_parent_commits: u32, name: String, - pub(super) commit_id_length: usize, - pub(super) change_id_length: usize, + commit_id_length: usize, + change_id_length: usize, commit_graph_entry_size: usize, commit_lookup_entry_size: usize, // Number of commits not counting the parent file @@ -215,6 +215,14 @@ impl ReadonlyIndexSegment { &self.name } + pub(super) fn commit_id_length(&self) -> usize { + self.commit_id_length + } + + pub(super) fn change_id_length(&self) -> usize { + self.change_id_length + } + fn graph_entry(&self, local_pos: u32) -> CommitGraphEntry { let offset = (local_pos as usize) * self.commit_graph_entry_size; CommitGraphEntry {