@@ -97,7 +97,7 @@ bool WriteTree::RemoveWrite(WriteId write_id) {
9797 // The removed write was completely shadowed by a subsequent write.
9898 removed_write_was_visible = false ;
9999 break ;
100- } else if (write_to_remove.path .StartsWith (current_write.path )) {
100+ } else if (write_to_remove.path .IsParent (current_write.path )) {
101101 // Either we're covering some writes or they're covering part of us
102102 // (depending on which came first).
103103 removed_write_overlaps_with_other_writes = true ;
@@ -198,8 +198,8 @@ Optional<Variant> WriteTree::CalcCompleteEventCache(
198198 filter_data->write_ids_to_exclude ->end (),
199199 write.write_id );
200200 if (iter == filter_data->write_ids_to_exclude ->end ()) {
201- return write.path .StartsWith (*filter_data->tree_path ) ||
202- filter_data->tree_path ->StartsWith (write.path );
201+ return write.path .IsParent (*filter_data->tree_path ) ||
202+ filter_data->tree_path ->IsParent (write.path );
203203 }
204204 }
205205 return false ;
@@ -358,12 +358,12 @@ Optional<Variant> WriteTree::ShadowingWrite(const Path& path) const {
358358bool WriteTree::RecordContainsPath (const UserWriteRecord& write_record,
359359 const Path& path) {
360360 if (write_record.is_overwrite ) {
361- return write_record.path .StartsWith (path);
361+ return write_record.path .IsParent (path);
362362 } else {
363363 bool result = false ;
364364 write_record.merge .write_tree ().CallOnEach (
365365 Path (), [&](const Path& current_path, Variant) {
366- if (write_record.path .GetChild (current_path).StartsWith (path)) {
366+ if (write_record.path .GetChild (current_path).IsParent (path)) {
367367 result = true ;
368368 }
369369 });
@@ -394,12 +394,12 @@ CompoundWrite WriteTree::LayerTree(const std::vector<UserWriteRecord>& writes,
394394 if (filter (write, filter_userdata)) {
395395 Path write_path = write.path ;
396396 if (write.is_overwrite ) {
397- if (tree_root.StartsWith (write_path)) {
397+ if (tree_root.IsParent (write_path)) {
398398 Optional<Path> relative_path =
399399 Path::GetRelative (tree_root, write_path);
400400 compound_write =
401401 compound_write.AddWrite (*relative_path, write.overwrite );
402- } else if (write_path.StartsWith (tree_root)) {
402+ } else if (write_path.IsParent (tree_root)) {
403403 compound_write = compound_write.AddWrite (
404404 Path (),
405405 VariantGetChild (&write.overwrite ,
@@ -409,12 +409,12 @@ CompoundWrite WriteTree::LayerTree(const std::vector<UserWriteRecord>& writes,
409409 // write
410410 }
411411 } else {
412- if (tree_root.StartsWith (write_path)) {
412+ if (tree_root.IsParent (write_path)) {
413413 Optional<Path> relative_path =
414414 Path::GetRelative (tree_root, write_path);
415415 compound_write =
416416 compound_write.AddWrites (*relative_path, write.merge );
417- } else if (write_path.StartsWith (tree_root)) {
417+ } else if (write_path.IsParent (tree_root)) {
418418 Optional<Path> relative_path =
419419 Path::GetRelative (write_path, tree_root);
420420 if (relative_path->empty ()) {
0 commit comments