index: make ReadonlyIndexImpl crate local

This ensure that callers will use ReadonlyIndexWrapper as the implementation
type.
This commit is contained in:
Yuya Nishihara 2023-05-26 15:57:26 +09:00
parent 93284a153f
commit b9c8fd8ef3

View file

@ -409,7 +409,7 @@ pub enum IndexLoadError {
// TODO: replace the table by a trie so we don't have to repeat the full commit // TODO: replace the table by a trie so we don't have to repeat the full commit
// ids // ids
// TODO: add a fanout table like git's commit graph has? // TODO: add a fanout table like git's commit graph has?
pub struct ReadonlyIndexImpl { pub(crate) struct ReadonlyIndexImpl {
parent_file: Option<Arc<ReadonlyIndexImpl>>, parent_file: Option<Arc<ReadonlyIndexImpl>>,
num_parent_commits: u32, num_parent_commits: u32,
name: String, name: String,
@ -484,7 +484,7 @@ impl MutableIndexImpl {
} }
} }
pub fn incremental(parent_file: Arc<ReadonlyIndexImpl>) -> Self { pub(crate) fn incremental(parent_file: Arc<ReadonlyIndexImpl>) -> Self {
let num_parent_commits = parent_file.num_parent_commits + parent_file.num_local_commits; let num_parent_commits = parent_file.num_parent_commits + parent_file.num_local_commits;
let commit_id_length = parent_file.commit_id_length; let commit_id_length = parent_file.commit_id_length;
let change_id_length = parent_file.change_id_length; let change_id_length = parent_file.change_id_length;