Move old index entry removal from "unpack_trees()" into the individual functions