Signed-off-by: Nicolas Pitre <n...@fluxnic.net>
---
 packv4-create.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/packv4-create.c b/packv4-create.c
index 6801e21..22e14da 100644
--- a/packv4-create.c
+++ b/packv4-create.c
@@ -13,6 +13,7 @@
 #include "tree-walk.h"
 #include "pack.h"
 #include "pack-revindex.h"
+#include "progress.h"
 
 
 static int pack_compression_seen;
@@ -609,8 +610,10 @@ static struct pack_idx_entry **sort_objs_by_offset(struct 
pack_idx_entry *list,
 static int create_pack_dictionaries(struct packed_git *p,
                                    struct pack_idx_entry **obj_list)
 {
+       struct progress *progress_state;
        unsigned int i;
 
+       progress_state = start_progress("Scanning objects", p->num_objects);
        for (i = 0; i < p->num_objects; i++) {
                struct pack_idx_entry *obj = obj_list[i];
                void *data;
@@ -619,6 +622,8 @@ static int create_pack_dictionaries(struct packed_git *p,
                struct object_info oi = {};
                int (*add_dict_entries)(void *, unsigned long);
 
+               display_progress(progress_state, i+1);
+
                oi.typep = &type;
                oi.sizep = &size;
                if (packed_object_info(p, obj->offset, &oi) < 0)
@@ -648,6 +653,7 @@ static int create_pack_dictionaries(struct packed_git *p,
                free(data);
        }
 
+       stop_progress(&progress_state);
        return 0;
 }
 
@@ -1002,6 +1008,7 @@ static void process_one_pack(char *src_pack, char 
*dst_pack)
        off_t written = 0;
        char *packname;
        unsigned char pack_sha1[20];
+       struct progress *progress_state;
 
        p = open_pack(src_pack);
        if (!p)
@@ -1023,6 +1030,7 @@ static void process_one_pack(char *src_pack, char 
*dst_pack)
        written += packv4_write_tables(f, nr_objects, objs);
 
        /* Let's write objects out, updating the object index list in place */
+       progress_state = start_progress("Writing objects", nr_objects);
        all_objs = objs;
        all_objs_nr = nr_objects;
        for (i = 0; i < nr_objects; i++) {
@@ -1032,7 +1040,9 @@ static void process_one_pack(char *src_pack, char 
*dst_pack)
                written += packv4_write_object(f, p, obj);
                obj->offset = obj_pos;
                obj->crc32 = crc32_end(f);
+               display_progress(progress_state, i+1);
        }
+       stop_progress(&progress_state);
 
        sha1close(f, pack_sha1, CSUM_CLOSE | CSUM_FSYNC);
 
-- 
1.8.4.22.g54757b7

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to