Code

Revert "builtin-archive: use RUN_SETUP"
[git.git] / builtin-pack-objects.c
index 73d448b890d61b79793290b6b9b9aceea0a89cdc..b5f9648e809a3ef7f381239470c031208ade4a34 100644 (file)
@@ -854,7 +854,7 @@ static void add_pbase_object(struct tree_desc *tree,
                unsigned long size;
                enum object_type type;
 
-               if (entry.pathlen != cmplen ||
+               if (tree_entry_len(entry.path, entry.sha1) != cmplen ||
                    memcmp(entry.path, name, cmplen) ||
                    !has_sha1_file(entry.sha1) ||
                    (type = sha1_object_info(entry.sha1, &size)) < 0)
@@ -873,8 +873,7 @@ static void add_pbase_object(struct tree_desc *tree,
                        tree = pbase_tree_get(entry.sha1);
                        if (!tree)
                                return;
-                       sub.buf = tree->tree_data;
-                       sub.size = tree->tree_size;
+                       init_tree_desc(&sub, tree->tree_data, tree->tree_size);
 
                        add_pbase_object(&sub, down, downlen, fullname);
                        pbase_tree_put(tree);
@@ -937,8 +936,7 @@ static void add_preferred_base_object(const char *name, unsigned hash)
                }
                else {
                        struct tree_desc tree;
-                       tree.buf = it->pcache.tree_data;
-                       tree.size = it->pcache.tree_size;
+                       init_tree_desc(&tree, it->pcache.tree_data, it->pcache.tree_size);
                        add_pbase_object(&tree, name, cmplen, name);
                }
        }