summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6b94b1a)
raw | patch | inline | side by side (parent: 6b94b1a)
author | Dana How <danahow@gmail.com> | |
Wed, 23 May 2007 17:11:33 +0000 (10:11 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 23 May 2007 18:09:48 +0000 (11:09 -0700) |
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>
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>
builtin-pack-objects.c | patch | blob | history |
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 930b57a34bf83f1570604af3c5a76e872faa7210..a4370bbee175ecb7ae95d6e8d93dea3c677c1b8c 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
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;
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.");