- die("cannot read %s", sha1_to_hex(sha1));
- write_header(sha1, TYPEFLAG_AUTO, basedir, prefix, path,
- mode, eltbuf, eltsize);
- if (!strcmp(elttype, "tree")) {
- this_prefix.name = path;
- traverse_tree(eltbuf, eltsize, &this_prefix);
- } else if (!strcmp(elttype, "blob") && !S_ISLNK(mode)) {
+ die("cannot read %s",
+ sha1_to_hex(item->item.any->sha1));
+ write_header(item->item.any->sha1, TYPEFLAG_AUTO, basedir,
+ prefix, item->name,
+ item->mode, eltbuf, eltsize);
+ if (item->directory) {
+ this_prefix.name = item->name;
+ traverse_tree(item->item.tree, &this_prefix);
+ } else if (!item->symlink) {