rebase-interactive: rewrite edit_todo_list() to handle the initial edit
[gitweb.git] / builtin / pack-objects.c
index e7ea206c08c6d4e81c3649e3988faf4794ce013c..24bba8147fc96ec2b124aa659c981af08e7a688d 100644 (file)
@@ -2610,7 +2610,7 @@ static void prepare_pack(int window, int depth)
        unsigned n;
 
        if (use_delta_islands)
-               resolve_tree_islands(progress, &to_pack);
+               resolve_tree_islands(the_repository, progress, &to_pack);
 
        get_object_details();
 
@@ -2786,9 +2786,11 @@ static void show_object(struct object *obj, const char *name, void *data)
 
        if (use_delta_islands) {
                const char *p;
-               unsigned depth = 0;
+               unsigned depth;
                struct object_entry *ent;
 
+               /* the empty string is a root tree, which is depth 0 */
+               depth = *name ? 1 : 0;
                for (p = strchr(name, '/'); p; p = strchr(p + 1, '/'))
                        depth++;
 
@@ -3129,7 +3131,7 @@ static void get_object_list(int ac, const char **av)
                return;
 
        if (use_delta_islands)
-               load_delta_islands();
+               load_delta_islands(the_repository);
 
        if (prepare_revision_walk(&revs))
                die(_("revision walk setup failed"));
@@ -3468,7 +3470,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
                }
        }
 
-       prepare_packing_data(&to_pack);
+       prepare_packing_data(the_repository, &to_pack);
 
        if (progress)
                progress_state = start_progress(_("Enumerating objects"), 0);