aboutsummaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-04-05 10:44:11 -0700
committerJunio C Hamano <gitster@pobox.com>2011-04-05 20:25:49 -0700
commit15366280c27e922ace0ba7d33cb3504dc59d742e (patch)
treefe512d5fabebbb2257b818e9cd3a530eb163e599 /builtin/pack-objects.c
parent7ed863a85a6ce2c4ac4476848310b8f917ab41f9 (diff)
downloadgit-15366280c27e922ace0ba7d33cb3504dc59d742e.tar.gz
git-15366280c27e922ace0ba7d33cb3504dc59d742e.tar.xz
Teach core.bigfilethreashold to pack-objects
The pack-objects command should take notice of the object file and refrain from attempting to delta large ones, to be consistent with the fast-import command. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index b0503b202..f402a843b 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1142,8 +1142,12 @@ static void get_object_details(void)
sorted_by_offset[i] = objects + i;
qsort(sorted_by_offset, nr_objects, sizeof(*sorted_by_offset), pack_offset_sort);
- for (i = 0; i < nr_objects; i++)
- check_object(sorted_by_offset[i]);
+ for (i = 0; i < nr_objects; i++) {
+ struct object_entry *entry = sorted_by_offset[i];
+ check_object(entry);
+ if (big_file_threshold <= entry->size)
+ entry->no_try_delta = 1;
+ }
free(sorted_by_offset);
}