MCPcopy Index your code
hub / github.com/git/git / git_default_config

Function git_default_config

environment.c:659–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

657}
658
659int git_default_config(const char *var, const char *value,
660 const struct config_context *ctx, void *cb)
661{
662 struct repo_config_values *cfg = repo_config_values(the_repository);
663
664 if (starts_with(var, "core."))
665 return git_default_core_config(var, value, ctx, cb);
666
667 if (starts_with(var, "user.") ||
668 starts_with(var, "author.") ||
669 starts_with(var, "committer."))
670 return git_ident_config(var, value, ctx, cb);
671
672 if (starts_with(var, "i18n."))
673 return git_default_i18n_config(var, value);
674
675 if (starts_with(var, "branch."))
676 return git_default_branch_config(var, value);
677
678 if (starts_with(var, "push."))
679 return git_default_push_config(var, value);
680
681 if (starts_with(var, "attr."))
682 return git_default_attr_config(var, value);
683
684 if (starts_with(var, "advice.") || starts_with(var, "color.advice"))
685 return git_default_advice_config(var, value);
686
687 if (!strcmp(var, "pager.color") || !strcmp(var, "color.pager")) {
688 pager_use_color = git_config_bool(var,value);
689 return 0;
690 }
691
692 if (!strcmp(var, "pack.packsizelimit")) {
693 pack_size_limit_cfg = git_config_ulong(var, value, ctx->kvi);
694 return 0;
695 }
696
697 if (!strcmp(var, "pack.compression")) {
698 int level = git_config_int(var, value, ctx->kvi);
699 if (level == -1)
700 level = Z_DEFAULT_COMPRESSION;
701 else if (level < 0 || level > Z_BEST_COMPRESSION)
702 die(_("bad pack compression level %d"), level);
703 cfg->pack_compression_level = level;
704 pack_compression_seen = 1;
705 return 0;
706 }
707
708 if (starts_with(var, "sparse."))
709 return git_default_sparse_config(var, value);
710
711 /* Add other config variables here and to Documentation/config.adoc. */
712 return 0;
713}
714
715void repo_config_values_init(struct repo_config_values *cfg)
716{

Callers 15

fetch_pack_config_cbFunction · 0.85
reflog_expire_configFunction · 0.85
fmt_merge_msg_configFunction · 0.85
http_optionsFunction · 0.85
git_xmerge_configFunction · 0.85
git_fsck_configFunction · 0.85
git_mailinfo_configFunction · 0.85
git_diff_basic_configFunction · 0.85
git_imap_configFunction · 0.85
git_mailinfo_configFunction · 0.85
git_tag_configFunction · 0.85

Calls 14

starts_withFunction · 0.85
git_default_core_configFunction · 0.85
git_ident_configFunction · 0.85
git_default_i18n_configFunction · 0.85
git_default_push_configFunction · 0.85
git_default_attr_configFunction · 0.85
git_config_boolFunction · 0.85
git_config_ulongFunction · 0.85
git_config_intFunction · 0.85

Tested by

no test coverage detected