summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-03 15:02:40 -0700
committerJunio C Hamano <gitster@pobox.com>2009-05-03 15:02:40 -0700
commit7d71be242d7fc8bd2eaef90e1848d71609c5c577 (patch)
tree7d3da3c0fafed46aebf41506d5e1136d2c2c387c /upload-pack.c
parenta2dc04ba159def766ee17db00c60bdbda477955d (diff)
parentcf2ab916afa4231f7e9db31796e7c0f712ff6ad1 (diff)
downloadgit-7d71be242d7fc8bd2eaef90e1848d71609c5c577.tar.gz
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 'upload-pack.c')
-rw-r--r--upload-pack.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 19c24db643..b98b1d61c1 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -78,20 +78,22 @@ static void show_commit(struct commit *commit)
commit->buffer = NULL;
}
-static void show_object(struct object_array_entry *p)
+static void show_object(struct object *obj, const struct name_path *path, const char *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 *name = path_name(path, component);
+ const char *ep = strchr(name, '\n');
if (ep) {
- fprintf(pack_pipe, "%s %.*s\n", sha1_to_hex(p->item->sha1),
- (int) (ep - p->name),
- p->name);
+ fprintf(pack_pipe, "%s %.*s\n", sha1_to_hex(obj->sha1),
+ (int) (ep - name),
+ name);
}
else
fprintf(pack_pipe, "%s %s\n",
- sha1_to_hex(p->item->sha1), p->name);
+ sha1_to_hex(obj->sha1), name);
+ free((char *)name);
}
static void show_edge(struct commit *commit)