Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index a6adc8c271..dde8cc3f01 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1856,13 +1856,17 @@ static void show_commit(struct commit *commit)
commit->object.flags |= OBJECT_ADDED;
}
-static void show_object(struct object_array_entry *p)
+static void show_object(struct object *obj, const char *name)
{
- 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;
+ 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)