diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-05 12:36:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-05 12:36:19 -0700 |
commit | f817f2fbb5e3dbe49be446438838a11b192c2715 (patch) | |
tree | 631f27ce82032851689e962945ce2fa5c5b06a9e /builtin/rev-list.c | |
parent | cd4093b6036af696310b1867e9e916485d53ccf4 (diff) | |
parent | beba25abbc34a07e07ce933210cda15202ef76cc (diff) | |
download | git-f817f2fbb5e3dbe49be446438838a11b192c2715.tar.gz |
Merge branch 'jc/traverse-commit-list'
* jc/traverse-commit-list:
revision.c: update show_object_with_name() without using malloc()
revision.c: add show_object_with_name() helper function
rev-list: fix finish_object() call
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r-- | builtin/rev-list.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c index 56727e8c1d..f5ce4873e3 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -176,21 +176,8 @@ static void finish_object(struct object *obj, const struct name_path *path, cons 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(name, '\n'); - - finish_object(obj, path, name); - if (ep) { - printf("%s %.*s\n", sha1_to_hex(obj->sha1), - (int) (ep - name), - name); - } - else - printf("%s %s\n", sha1_to_hex(obj->sha1), name); - free(name); + finish_object(obj, path, component); + show_object_with_name(stdout, obj, path, component); } static void show_edge(struct commit *commit) |