MDL-41907 Repositories: Maintain the sortorder of a file when overwriting it.