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

Function grep_cmd_config

builtin/grep.c:297–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297static int grep_cmd_config(const char *var, const char *value,
298 const struct config_context *ctx, void *cb)
299{
300 int st = grep_config(var, value, ctx, cb);
301
302 if (git_color_config(var, value, cb) < 0)
303 st = -1;
304 else if (git_default_config(var, value, ctx, cb) < 0)
305 st = -1;
306
307 if (!strcmp(var, "grep.threads")) {
308 num_threads = git_config_int(var, value, ctx->kvi);
309 if (num_threads < 0)
310 die(_("invalid number of threads specified (%d) for %s"),
311 num_threads, var);
312 else if (!HAVE_THREADS && num_threads > 1) {
313 /*
314 * TRANSLATORS: %s is the configuration
315 * variable for tweaking threads, currently
316 * grep.threads
317 */
318 warning(_("no threads support, ignoring %s"), var);
319 num_threads = 1;
320 }
321 }
322
323 if (!strcmp(var, "submodule.recurse"))
324 recurse_submodules = git_config_bool(var, value);
325
326 return st;
327}
328
329static void grep_source_name(struct grep_opt *opt, const char *filename,
330 int tree_name_len, struct strbuf *out)

Callers

nothing calls this directly

Calls 7

grep_configFunction · 0.85
git_color_configFunction · 0.85
git_default_configFunction · 0.85
git_config_intFunction · 0.85
warningFunction · 0.85
git_config_boolFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected