X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pack-objects.c;h=861c7f08ff1b68eee141442411b4706a1bcc2518;hb=0881d2d1303a067a02e3811d43a1aed04a47945e;hp=b486ea528afed6acb19955fdfae770ec6037ff3f;hpb=49b2788539016e7fd20559bea11b306ade0183b7;p=git.git diff --git a/pack-objects.c b/pack-objects.c index b486ea528..861c7f08f 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -28,7 +28,7 @@ struct object_entry { struct object_entry *delta; /* delta base object */ struct packed_git *in_pack; /* already in pack */ unsigned int in_pack_offset; - struct object_entry *delta_child; /* delitified objects who bases me */ + struct object_entry *delta_child; /* deltified objects who bases me */ struct object_entry *delta_sibling; /* other deltified objects who * uses the same base as me */ @@ -39,7 +39,7 @@ struct object_entry { }; /* - * Objects we are going to pack are colected in objects array (dynamically + * Objects we are going to pack are collected in objects array (dynamically * expanded). nr_objects & nr_alloc controls this array. They are stored * in the order we see -- typically rev-list --objects order that gives us * nice "minimum seek" order. @@ -63,6 +63,7 @@ static const char *base_name; static unsigned char pack_file_sha1[20]; static int progress = 1; static volatile sig_atomic_t progress_update = 0; +static int window = 10; /* * The object names in objects array are hashed with this hashtable, @@ -1216,16 +1217,26 @@ static void setup_progress_signal(void) setitimer(ITIMER_REAL, &v, NULL); } +static int git_pack_config(const char *k, const char *v) +{ + if(!strcmp(k, "pack.window")) { + window = git_config_int(k, v); + return 0; + } + return git_default_config(k, v); +} + int main(int argc, char **argv) { SHA_CTX ctx; char line[40 + 1 + PATH_MAX + 2]; - int window = 10, depth = 10, pack_to_stdout = 0; + int depth = 10, pack_to_stdout = 0; struct object_entry **list; int num_preferred_base = 0; int i; setup_git_directory(); + git_config(git_pack_config); progress = isatty(2); for (i = 1; i < argc; i++) {