{"thread":{"id":"8283","subject":"[PATCH] pack-objects: clarification & option checks for --max-pack-size","startedAt":"2007-05-23T17:11:33Z","lastAt":"2007-05-23T17:11:33Z","messageCount":1,"participants":["Dana How"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"43039","messageId":"465475C5.6000404@gmail.com","threadId":"8283","inReplyTo":null,"subject":"[PATCH] pack-objects: clarification & option checks for --max-pack-size","fromName":"Dana How","fromEmail":"danahow@gmail.com","sentAt":"2007-05-23T17:11:33Z","receivedAt":"2007-05-23T17:11:33Z","isPatch":true,"sender":{"key":"danahow@gmail.com","avatar":null},"body":"\nExplain the special code for detecting a corner-case error,\nand complain about --stdout & --max-pack-size being used together.\n\nSigned-off-by: Dana L. How <danahow@gmail.com>\n---\n builtin-pack-objects.c |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-pack-objects.c b/builtin-pack-objects.c\nindex 19b0aa1..a5bade6 100644\n--- a/builtin-pack-objects.c\n+++ b/builtin-pack-objects.c\n@@ -679,6 +679,12 @@ static void write_pack_file(void)\n \t\tstop_progress(&progress_state);\n \tif (written != nr_result)\n \t\tdie(\"wrote %u objects while expecting %u\", written, nr_result);\n+\t/*\n+\t * We have scanned through [0 ... i).  Since we have written\n+\t * the correct number of objects,  the remaining [i ... nr_objects)\n+\t * items must be either already written (due to out-of-order delta base)\n+\t * or a preferred base.  Count those which are neither and complain if any.\n+\t */\n \tfor (j = 0; i < nr_objects; i++) {\n \t\tstruct object_entry *e = objects + i;\n \t\tj += !e->offset && !e->preferred_base;\n@@ -1852,6 +1858,9 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)\n \tif (pack_to_stdout != !base_name)\n \t\tusage(pack_usage);\n \n+\tif (pack_to_stdout && pack_size_limit)\n+\t\tdie(\"--max-pack-size cannot be used to build a pack for transfer.\");\n+\n \tif (!pack_to_stdout && thin)\n \t\tdie(\"--thin cannot be used to build an indexable pack.\");\n \n-- \n1.5.2.762.gd8c6-dirty\n"}]}