| 113 | }; |
| 114 | |
| 115 | static int git_fetch_config(const char *k, const char *v, |
| 116 | const struct config_context *ctx, void *cb) |
| 117 | { |
| 118 | struct fetch_config *fetch_config = cb; |
| 119 | |
| 120 | if (!strcmp(k, "fetch.all")) { |
| 121 | fetch_config->all = git_config_bool(k, v); |
| 122 | return 0; |
| 123 | } |
| 124 | |
| 125 | if (!strcmp(k, "fetch.prune")) { |
| 126 | fetch_config->prune = git_config_bool(k, v); |
| 127 | return 0; |
| 128 | } |
| 129 | |
| 130 | if (!strcmp(k, "fetch.prunetags")) { |
| 131 | fetch_config->prune_tags = git_config_bool(k, v); |
| 132 | return 0; |
| 133 | } |
| 134 | |
| 135 | if (!strcmp(k, "fetch.showforcedupdates")) { |
| 136 | fetch_config->show_forced_updates = git_config_bool(k, v); |
| 137 | return 0; |
| 138 | } |
| 139 | |
| 140 | if (!strcmp(k, "submodule.recurse")) { |
| 141 | int r = git_config_bool(k, v) ? |
| 142 | RECURSE_SUBMODULES_ON : RECURSE_SUBMODULES_OFF; |
| 143 | fetch_config->recurse_submodules = r; |
| 144 | return 0; |
| 145 | } |
| 146 | |
| 147 | if (!strcmp(k, "submodule.fetchjobs")) { |
| 148 | fetch_config->submodule_fetch_jobs = parse_submodule_fetchjobs(k, v, ctx->kvi); |
| 149 | return 0; |
| 150 | } else if (!strcmp(k, "fetch.recursesubmodules")) { |
| 151 | fetch_config->recurse_submodules = parse_fetch_recurse_submodules_arg(k, v); |
| 152 | return 0; |
| 153 | } |
| 154 | |
| 155 | if (!strcmp(k, "fetch.parallel")) { |
| 156 | fetch_config->parallel = git_config_int(k, v, ctx->kvi); |
| 157 | if (fetch_config->parallel < 0) |
| 158 | die(_("fetch.parallel cannot be negative")); |
| 159 | if (!fetch_config->parallel) |
| 160 | fetch_config->parallel = online_cpus(); |
| 161 | return 0; |
| 162 | } |
| 163 | |
| 164 | if (!strcmp(k, "fetch.output")) { |
| 165 | if (!v) |
| 166 | return config_error_nonbool(k); |
| 167 | else if (!strcasecmp(v, "full")) |
| 168 | fetch_config->display_format = DISPLAY_FORMAT_FULL; |
| 169 | else if (!strcasecmp(v, "compact")) |
| 170 | fetch_config->display_format = DISPLAY_FORMAT_COMPACT; |
| 171 | else |
| 172 | die(_("invalid value for '%s': '%s'"), |
nothing calls this directly
no test coverage detected