X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=builtin-rev-list.c;h=2b298c4e412c4fca24ea5068f17a557f89a6a449;hb=d3ff6f55012c939740ce0982b24aeb6fba3c6e4f;hp=6e2b898cca7213d4c49e38bb431ac85ddea0e062;hpb=2d9c58c69d1bab601e67b036d0546e85abcee7eb;p=git.git diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 6e2b898c..2b298c4e 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -114,6 +114,7 @@ static struct object_list **process_tree(struct tree *tree, { struct object *obj = &tree->object; struct tree_desc desc; + struct name_entry entry; struct name_path me; if (!revs.tree_objects) @@ -132,18 +133,11 @@ static struct object_list **process_tree(struct tree *tree, desc.buf = tree->buffer; desc.size = tree->size; - while (desc.size) { - unsigned mode; - const char *name; - const unsigned char *sha1; - - sha1 = tree_entry_extract(&desc, &name, &mode); - update_tree_entry(&desc); - - if (S_ISDIR(mode)) - p = process_tree(lookup_tree(sha1), p, &me, name); + while (tree_entry(&desc, &entry)) { + if (S_ISDIR(entry.mode)) + p = process_tree(lookup_tree(entry.sha1), p, &me, entry.path); else - p = process_blob(lookup_blob(sha1), p, &me, name); + p = process_blob(lookup_blob(entry.sha1), p, &me, entry.path); } free(tree->buffer); tree->buffer = NULL; @@ -164,16 +158,16 @@ static void show_commit_list(struct rev_info *revs) const char *name = pending->name; if (obj->flags & (UNINTERESTING | SEEN)) continue; - if (obj->type == tag_type) { + if (obj->type == TYPE_TAG) { obj->flags |= SEEN; p = add_object(obj, p, NULL, name); continue; } - if (obj->type == tree_type) { + if (obj->type == TYPE_TREE) { p = process_tree((struct tree *)obj, p, NULL, name); continue; } - if (obj->type == blob_type) { + if (obj->type == TYPE_BLOB) { p = process_blob((struct blob *)obj, p, NULL, name); continue; }