Rework `Copy_db_to_head` & `Drop_master`