sha1_file: convert index_path and index_fd to struct object_id