From: Junio C Hamano Date: Mon, 1 Apr 2013 16:06:19 +0000 (-0700) Subject: Merge branch 'jk/index-pack-correct-depth-fix' X-Git-Url: https://repo.or.cz/w/git/mingw.git/commitdiff_plain/ed8852c286273405e5898e44bda57d2d48d2b4cb Merge branch 'jk/index-pack-correct-depth-fix' "index-pack --fix-thin" used uninitialize value to compute delta depths of objects it appends to the resulting pack. * jk/index-pack-correct-depth-fix: index-pack: always zero-initialize object_entry list --- ed8852c286273405e5898e44bda57d2d48d2b4cb diff --cc builtin/index-pack.c index ef62124aa4,6922086376..3a3051d53e --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@@ -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,