block alloc: allocate cache entries from mem_pool
[gitweb.git] / blame.c
diff --git a/blame.c b/blame.c
index 14d0e0b5751c2abaad16dac81a71436ca29ddde4..4c6668d0e16ad8f52df763f5e5f2fd849deb5b2c 100644 (file)
--- a/blame.c
+++ b/blame.c
@@ -154,7 +154,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
        struct strbuf buf = STRBUF_INIT;
        const char *ident;
        time_t now;
-       int size, len;
+       int len;
        struct cache_entry *ce;
        unsigned mode;
        struct strbuf msg = STRBUF_INIT;
@@ -252,8 +252,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
                        /* Let's not bother reading from HEAD tree */
                        mode = S_IFREG | 0644;
        }
-       size = cache_entry_size(len);
-       ce = xcalloc(1, size);
+       ce = make_empty_cache_entry(&the_index, len);
        oidcpy(&ce->oid, &origin->blob_oid);
        memcpy(ce->name, path, len);
        ce->ce_flags = create_ce_flags(0);