Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
---
 nr_objects contains a lot more than the number of objects to be
 written.

 builtin/pack-objects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index b60b1a0..39d1e08 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -872,7 +872,7 @@ static void write_pack_file(void)
                         * Pack v4 thin pack is terminated by a "type
                         * 0, size 0" in variable length encoding
                         */
-                       if (pack_version == 4 && nr_written < nr_objects)
+                       if (pack_version == 4 && nr_written < v4.all_objs_nr)
                                sha1write(f, &type_zero, 1);
                        sha1close(f, sha1, CSUM_CLOSE);
                } else if (nr_written == nr_remaining) {
-- 
1.8.2.82.gc24b958

--
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