fixed ordering of arguments for repo.write