summaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorDana How <danahow@gmail.com>2007-05-23 10:11:33 -0700
committerJunio C Hamano <junkio@cox.net>2007-05-23 11:09:48 -0700
commit01c12a23121780b7b1d84943fe310cf8773f8745 (patch)
tree984a8b8c1e902cbf4af084a802a7fe898ed68719 /builtin-pack-objects.c
parent6b94b1a09af9cf877f0bc43d6097bce56f856866 (diff)
downloadgit-01c12a23121780b7b1d84943fe310cf8773f8745.tar.gz
pack-objects: clarification & option checks for --max-pack-size
Explain the special code for detecting a corner-case error, and complain about --stdout & --max-pack-size being used together. Signed-off-by: Dana L. How <danahow@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 930b57a34b..a4370bbee1 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -677,6 +677,12 @@ static void write_pack_file(void)
stop_progress(&progress_state);
if (written != nr_result)
die("wrote %u objects while expecting %u", written, nr_result);
+ /*
+ * We have scanned through [0 ... i). Since we have written
+ * the correct number of objects, the remaining [i ... nr_objects)
+ * items must be either already written (due to out-of-order delta base)
+ * or a preferred base. Count those which are neither and complain if any.
+ */
for (j = 0; i < nr_objects; i++) {
struct object_entry *e = objects + i;
j += !e->offset && !e->preferred_base;
@@ -1818,6 +1824,9 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
if (pack_to_stdout != !base_name)
usage(pack_usage);
+ if (pack_to_stdout && pack_size_limit)
+ die("--max-pack-size cannot be used to build a pack for transfer.");
+
if (!pack_to_stdout && thin)
die("--thin cannot be used to build an indexable pack.");