@@ -97,7 +97,7 @@ bool WriteTree::RemoveWrite(WriteId write_id) {
97
97
// The removed write was completely shadowed by a subsequent write.
98
98
removed_write_was_visible = false ;
99
99
break ;
100
- } else if (write_to_remove.path .StartsWith (current_write.path )) {
100
+ } else if (write_to_remove.path .IsParent (current_write.path )) {
101
101
// Either we're covering some writes or they're covering part of us
102
102
// (depending on which came first).
103
103
removed_write_overlaps_with_other_writes = true ;
@@ -198,8 +198,8 @@ Optional<Variant> WriteTree::CalcCompleteEventCache(
198
198
filter_data->write_ids_to_exclude ->end (),
199
199
write.write_id );
200
200
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 );
203
203
}
204
204
}
205
205
return false ;
@@ -358,12 +358,12 @@ Optional<Variant> WriteTree::ShadowingWrite(const Path& path) const {
358
358
bool WriteTree::RecordContainsPath (const UserWriteRecord& write_record,
359
359
const Path& path) {
360
360
if (write_record.is_overwrite ) {
361
- return write_record.path .StartsWith (path);
361
+ return write_record.path .IsParent (path);
362
362
} else {
363
363
bool result = false ;
364
364
write_record.merge .write_tree ().CallOnEach (
365
365
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)) {
367
367
result = true ;
368
368
}
369
369
});
@@ -394,12 +394,12 @@ CompoundWrite WriteTree::LayerTree(const std::vector<UserWriteRecord>& writes,
394
394
if (filter (write, filter_userdata)) {
395
395
Path write_path = write.path ;
396
396
if (write.is_overwrite ) {
397
- if (tree_root.StartsWith (write_path)) {
397
+ if (tree_root.IsParent (write_path)) {
398
398
Optional<Path> relative_path =
399
399
Path::GetRelative (tree_root, write_path);
400
400
compound_write =
401
401
compound_write.AddWrite (*relative_path, write.overwrite );
402
- } else if (write_path.StartsWith (tree_root)) {
402
+ } else if (write_path.IsParent (tree_root)) {
403
403
compound_write = compound_write.AddWrite (
404
404
Path (),
405
405
VariantGetChild (&write.overwrite ,
@@ -409,12 +409,12 @@ CompoundWrite WriteTree::LayerTree(const std::vector<UserWriteRecord>& writes,
409
409
// write
410
410
}
411
411
} else {
412
- if (tree_root.StartsWith (write_path)) {
412
+ if (tree_root.IsParent (write_path)) {
413
413
Optional<Path> relative_path =
414
414
Path::GetRelative (tree_root, write_path);
415
415
compound_write =
416
416
compound_write.AddWrites (*relative_path, write.merge );
417
- } else if (write_path.StartsWith (tree_root)) {
417
+ } else if (write_path.IsParent (tree_root)) {
418
418
Optional<Path> relative_path =
419
419
Path::GetRelative (write_path, tree_root);
420
420
if (relative_path->empty ()) {
0 commit comments