Its not safe to mutate the inventory in this way. You're aliasing the entry in the basis with the working tree, and later mutations will alter both inventories. It will also be copying all the children in which will fail badly if the children weren't all removed.
So the right way to do this is to create a new inventory entry with the right file id, parent id, kind and basename.
Its not safe to mutate the inventory in this way. You're aliasing the entry in the basis with the working tree, and later mutations will alter both inventories. It will also be copying all the children in which will fail badly if the children weren't all removed.
So the right way to do this is to create a new inventory entry with the right file id, parent id, kind and basename.