{"thread":{"id":"43560","subject":"[PATCH] pack-objects: remove redundent status information","startedAt":"2006-11-29T22:15:48Z","lastAt":"2006-11-29T22:15:48Z","messageCount":1,"participants":["Nicolas Pitre"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"295528","messageId":"Pine.LNX.4.64.0611291704440.9647@xanadu.home","threadId":"43560","inReplyTo":null,"subject":"[PATCH] pack-objects: remove redundent status information","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-11-29T22:15:48Z","receivedAt":"2006-11-29T22:15:48Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"The final 'nr_result' and 'written' values must always be the same \notherwise we're in deep trouble.  So let's remove a redundent report.\n\nAnd for paranoia sake let's make sure those two variables are actually \nequal after all objects are written (one never knows).\n\nSigned-off-by: Nicolas Pitre <nico@cam.org>\n\n---\n\ndiff --git a/builtin-pack-objects.c b/builtin-pack-objects.c\nindex 753bcd5..a2dc7d1 100644\n--- a/builtin-pack-objects.c\n+++ b/builtin-pack-objects.c\n@@ -514,6 +514,8 @@ static void write_pack_file(void)\n \tif (do_progress)\n \t\tfputc('\\n', stderr);\n  done:\n+\tif (written != nr_result)\n+\t\tdie(\"wrote %d objects while expecting %d\", written, nr_result);\n \tsha1close(f, pack_file_sha1, 1);\n }\n \n@@ -1662,7 +1664,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \t\t}\n \t}\n \tif (progress)\n-\t\tfprintf(stderr, \"Total %d, written %d (delta %d), reused %d (delta %d)\\n\",\n-\t\t\tnr_result, written, written_delta, reused, reused_delta);\n+\t\tfprintf(stderr, \"Total %d (delta %d), reused %d (delta %d)\\n\",\n+\t\t\twritten, written_delta, reused, reused_delta);\n \treturn 0;\n"}]}