index: use name() instead of direct field access

This commit is contained in:
Yuya Nishihara 2023-12-11 20:41:46 +09:00
parent e5c8252fb4
commit 30984b1505
2 changed files with 4 additions and 4 deletions

View file

@ -153,7 +153,7 @@ impl MutableIndexSegment {
continue;
}
let own_ancestor = maybe_own_ancestor.as_ref().unwrap();
if own_ancestor.name == other_ancestor.name {
if own_ancestor.name() == other_ancestor.name() {
break;
}
if own_ancestor.as_composite().num_commits()
@ -179,9 +179,9 @@ impl MutableIndexSegment {
let mut buf = vec![];
if let Some(parent_file) = &self.parent_file {
buf.write_u32::<LittleEndian>(parent_file.name.len() as u32)
buf.write_u32::<LittleEndian>(parent_file.name().len() as u32)
.unwrap();
buf.write_all(parent_file.name.as_bytes()).unwrap();
buf.write_all(parent_file.name().as_bytes()).unwrap();
} else {
buf.write_u32::<LittleEndian>(0).unwrap();
}

View file

@ -125,7 +125,7 @@ impl CommitLookupEntry<'_> {
pub(super) struct ReadonlyIndexSegment {
parent_file: Option<Arc<ReadonlyIndexSegment>>,
pub(super) num_parent_commits: u32,
pub(super) name: String,
name: String,
pub(super) commit_id_length: usize,
pub(super) change_id_length: usize,
commit_graph_entry_size: usize,