Merge branch 'jk/index-pack-correct-depth-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 4 Apr 2013 20:00:37 +0000 (13:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Apr 2013 20:00:37 +0000 (13:00 -0700)
* jk/index-pack-correct-depth-fix:
index-pack: always zero-initialize object_entry list

1  2 
builtin/index-pack.c
index ef62124aa491a9ac1e430d5baa3cf448902ac9c4,6922086376839e85ce43a5334ba67e18bb6f4c04..3a3051d53e03cfb51d7eb156356f158e11f64b10
@@@ -1107,12 -1106,13 +1107,14 @@@ static void conclude_pack(int fix_thin_
                objects = xrealloc(objects,
                                   (nr_objects + nr_unresolved + 1)
                                   * sizeof(*objects));
+               memset(objects + nr_objects + 1, 0,
+                      nr_unresolved * sizeof(*objects));
                f = sha1fd(output_fd, curr_pack);
                fix_unresolved_deltas(f, nr_unresolved);
 -              sprintf(msg, "completed with %d local objects",
 -                      nr_objects - nr_objects_initial);
 -              stop_progress_msg(&progress, msg);
 +              strbuf_addf(&msg, _("completed with %d local objects"),
 +                          nr_objects - nr_objects_initial);
 +              stop_progress_msg(&progress, msg.buf);
 +              strbuf_release(&msg);
                sha1close(f, tail_sha1, 0);
                hashcpy(read_sha1, pack_sha1);
                fixup_pack_header_footer(output_fd, pack_sha1,