read-tree: Fix regression with creation of a new index file.