# # # patch "roster_merge.cc" # from [2e98d418ae3699fc7833dc9f0420ffaa6711d5d0] # to [a08c52e7db7e3718bf02f3e078d1d771fa184567] # ============================================================ --- roster_merge.cc 2e98d418ae3699fc7833dc9f0420ffaa6711d5d0 +++ roster_merge.cc a08c52e7db7e3718bf02f3e078d1d771fa184567 @@ -1768,6 +1768,42 @@ } }; +struct rename_target_plus_missing_root : public structural_conflict_helper +{ + node_id left_root_nid, right_root_nid; + + virtual void setup() + { + left_root_nid = nis.next(); + right_root_nid = nis.next(); + + left_roster.drop_detached_node(left_roster.detach_node(split(""))); + safe_erase(left_markings, root_nid); + make_dir(left_roster, left_markings, left_rid, left_rid, "", left_root_nid); + + right_roster.drop_detached_node(right_roster.detach_node(split(""))); + safe_erase(right_markings, root_nid); + make_dir(right_roster, right_markings, right_rid, right_rid, "", right_root_nid); + } + virtual void check() + { + I(!result.is_clean()); + rename_target_conflict const & c = idx(result.rename_target_conflicts, 0); + I((c.nid1 == left_root_nid && c.nid2 == right_root_nid) + || (c.nid1 == right_root_nid && c.nid2 == left_root_nid)); + I(c.parent_name == std::make_pair(the_null_node, the_null_component)); + + I(result.missing_root_dir); + + result.roster.attach_node(left_root_nid, split("")); + result.roster.attach_node(right_root_nid, split("totally_other_name")); + result.rename_target_conflicts.pop_back(); + result.missing_root_dir = false; + I(result.is_clean()); + result.roster.check_sane(); + } +}; + static void test_complex_structural_conflicts() { @@ -1791,6 +1827,10 @@ node_name_plus_missing_root t; t.test(); } + { + rename_target_plus_missing_root t; + t.test(); + } } void