diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-05-03 15:02:40 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-05-03 15:02:40 -0700 |
commit | 7d71be242d7fc8bd2eaef90e1848d71609c5c577 (patch) | |
tree | 7d3da3c0fafed46aebf41506d5e1136d2c2c387c /builtin-rev-list.c | |
parent | a2dc04ba159def766ee17db00c60bdbda477955d (diff) | |
parent | cf2ab916afa4231f7e9db31796e7c0f712ff6ad1 (diff) | |
download | git-7d71be242d7fc8bd2eaef90e1848d71609c5c577.tar.gz git-7d71be242d7fc8bd2eaef90e1848d71609c5c577.tar.xz |
Merge branch 'lt/pack-object-memuse' into maint
* lt/pack-object-memuse:
show_object(): push path_name() call further down
process_{tree,blob}: show objects without buffering
Diffstat (limited to 'builtin-rev-list.c')
-rw-r--r-- | builtin-rev-list.c | 22 |
1 files changed, 12 insertions, 10 deletions
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) |