Merge branch 'jk/pack-objects-reports-num-objects-to-trace2'
authorJunio C Hamano <gitster@pobox.com>
Wed, 8 May 2019 15:37:23 +0000 (00:37 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 May 2019 15:37:23 +0000 (00:37 +0900)
The "git pack-objects" command learned to report the number of
objects it packed via the trace2 mechanism.

* jk/pack-objects-reports-num-objects-to-trace2:
pack-objects: write objects packed to trace2

1  2 
builtin/pack-objects.c
diff --combined builtin/pack-objects.c
index 2d9a3bdc9d83e24759b5a8892c26863bd9829c34,3326aeb497ec336411d569ba10e3ea83855e2319..d7743f110bce610a20fd7089d8181a8c36f60e80
@@@ -964,6 -964,8 +964,8 @@@ static void write_pack_file(void
        if (written != nr_result)
                die(_("wrote %"PRIu32" objects while expecting %"PRIu32),
                    written, nr_result);
+       trace2_data_intmax("pack-objects", the_repository,
+                          "write_pack_file/wrote", nr_result);
  }
  
  static int no_try_delta(const char *path)
@@@ -1487,7 -1489,6 +1489,7 @@@ static int can_reuse_delta(const unsign
                           struct object_entry **base_out)
  {
        struct object_entry *base;
 +      struct object_id base_oid;
  
        if (!base_sha1)
                return 0;
         * even if it was buried too deep in history to make it into the
         * packing list.
         */
 -      if (thin && bitmap_has_sha1_in_uninteresting(bitmap_git, base_sha1)) {
 +      oidread(&base_oid, base_sha1);
 +      if (thin && bitmap_has_oid_in_uninteresting(bitmap_git, &base_oid)) {
                if (use_delta_islands) {
 -                      struct object_id base_oid;
 -                      hashcpy(base_oid.hash, base_sha1);
                        if (!in_same_island(&delta->idx.oid, &base_oid))
                                return 0;
                }