MCPcopy Create free account
hub / github.com/git/git / git_pack_config

Function git_pack_config

builtin/pack-objects.c:3671–3781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3669}
3670
3671static int git_pack_config(const char *k, const char *v,
3672 const struct config_context *ctx, void *cb)
3673{
3674 if (!strcmp(k, "pack.window")) {
3675 window = git_config_int(k, v, ctx->kvi);
3676 return 0;
3677 }
3678 if (!strcmp(k, "pack.windowmemory")) {
3679 window_memory_limit = git_config_ulong(k, v, ctx->kvi);
3680 return 0;
3681 }
3682 if (!strcmp(k, "pack.depth")) {
3683 depth = git_config_int(k, v, ctx->kvi);
3684 return 0;
3685 }
3686 if (!strcmp(k, "pack.deltacachesize")) {
3687 max_delta_cache_size = git_config_int(k, v, ctx->kvi);
3688 return 0;
3689 }
3690 if (!strcmp(k, "pack.deltacachelimit")) {
3691 cache_max_small_delta_size = git_config_int(k, v, ctx->kvi);
3692 return 0;
3693 }
3694 if (!strcmp(k, "pack.writebitmaphashcache")) {
3695 if (git_config_bool(k, v))
3696 write_bitmap_options |= BITMAP_OPT_HASH_CACHE;
3697 else
3698 write_bitmap_options &= ~BITMAP_OPT_HASH_CACHE;
3699 }
3700
3701 if (!strcmp(k, "pack.writebitmaplookuptable")) {
3702 if (git_config_bool(k, v))
3703 write_bitmap_options |= BITMAP_OPT_LOOKUP_TABLE;
3704 else
3705 write_bitmap_options &= ~BITMAP_OPT_LOOKUP_TABLE;
3706 }
3707
3708 if (!strcmp(k, "pack.usebitmaps")) {
3709 use_bitmap_index_default = git_config_bool(k, v);
3710 return 0;
3711 }
3712 if (!strcmp(k, "pack.allowpackreuse")) {
3713 int res = git_parse_maybe_bool_text(v);
3714 if (res < 0) {
3715 if (!strcasecmp(v, "single"))
3716 allow_pack_reuse = SINGLE_PACK_REUSE;
3717 else if (!strcasecmp(v, "multi"))
3718 allow_pack_reuse = MULTI_PACK_REUSE;
3719 else
3720 die(_("invalid pack.allowPackReuse value: '%s'"), v);
3721 } else if (res) {
3722 allow_pack_reuse = SINGLE_PACK_REUSE;
3723 } else {
3724 allow_pack_reuse = NO_PACK_REUSE;
3725 }
3726 return 0;
3727 }
3728 if (!strcmp(k, "pack.threads")) {

Callers

nothing calls this directly

Calls 14

git_config_intFunction · 0.85
git_config_ulongFunction · 0.85
git_config_boolFunction · 0.85
warningFunction · 0.85
config_error_nonboolFunction · 0.85
parse_oid_hexFunction · 0.85
oidmap_getFunction · 0.85
xcallocFunction · 0.85
xstrdupFunction · 0.85
oidmap_putFunction · 0.85
git_default_configFunction · 0.85

Tested by

no test coverage detected