X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-rev-list.c;h=0af7cd94f99728e08379441061098e1966e36b73;hb=ee27ca4a781844ddbf556ec64daae24d748a7c5a;hp=436afa45f5b7569551aa8301aee8a0752009a900;hpb=f054a419419337142ffe40433aa3984ccc000624;p=git.git diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 436afa45f..0af7cd94f 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -168,27 +168,29 @@ static void finish_commit(struct commit *commit) commit->buffer = NULL; } -static void finish_object(struct object_array_entry *p) +static void finish_object(struct object *obj, const struct name_path *path, const char *name) { - if (p->item->type == OBJ_BLOB && !has_sha1_file(p->item->sha1)) - die("missing blob object '%s'", sha1_to_hex(p->item->sha1)); + if (obj->type == OBJ_BLOB && !has_sha1_file(obj->sha1)) + die("missing blob object '%s'", sha1_to_hex(obj->sha1)); } -static void show_object(struct object_array_entry *p) +static void show_object(struct object *obj, const struct name_path *path, const char *component) { + char *name = path_name(path, component); /* An object with name "foo\n0000000..." can be used to * confuse downstream "git pack-objects" very badly. */ - const char *ep = strchr(p->name, '\n'); + const char *ep = strchr(name, '\n'); - finish_object(p); + finish_object(obj, path, name); if (ep) { - printf("%s %.*s\n", sha1_to_hex(p->item->sha1), - (int) (ep - p->name), - p->name); + printf("%s %.*s\n", sha1_to_hex(obj->sha1), + (int) (ep - name), + name); } else - printf("%s %s\n", sha1_to_hex(p->item->sha1), p->name); + printf("%s %s\n", sha1_to_hex(obj->sha1), name); + free(name); } static void show_edge(struct commit *commit)