summaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-18 14:46:17 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-18 14:46:17 -0700
commit9824a388e53ba0951e38f246038fa0ef6fda3397 (patch)
treeafae88c319c71b70dfd76de729222af8490f2dd0 /builtin-pack-objects.c
parent5758b25da43c401cad33f3304f78084a0305d21c (diff)
parentcf2ab916afa4231f7e9db31796e7c0f712ff6ad1 (diff)
downloadgit-9824a388e53ba0951e38f246038fa0ef6fda3397.tar.gz
Merge branch 'lt/pack-object-memuse'
* lt/pack-object-memuse: show_object(): push path_name() call further down process_{tree,blob}: show objects without buffering Conflicts: builtin-pack-objects.c builtin-rev-list.c list-objects.c list-objects.h upload-pack.c
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index d3360ac1f8..419f29aa1a 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1907,13 +1907,19 @@ static void show_commit(struct commit *commit, void *data)
commit->object.flags |= OBJECT_ADDED;
}
-static void show_object(struct object_array_entry *p, void *data)
+static void show_object(struct object *obj, const struct name_path *path, const char *last)
{
- add_preferred_base_object(p->name);
- add_object_entry(p->item->sha1, p->item->type, p->name, 0);
- p->item->flags |= OBJECT_ADDED;
- free((char *)p->name);
- p->name = NULL;
+ char *name = path_name(path, last);
+
+ add_preferred_base_object(name);
+ add_object_entry(obj->sha1, obj->type, name, 0);
+ obj->flags |= OBJECT_ADDED;
+
+ /*
+ * We will have generated the hash from the name,
+ * but not saved a pointer to it - we can free it
+ */
+ free((char *)name);
}
static void show_edge(struct commit *commit)