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

Function fsmonitor_config

builtin/fsmonitor--daemon.c:45–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43static int fsmonitor__announce_startup = 0;
44
45static int fsmonitor_config(const char *var, const char *value,
46 const struct config_context *ctx, void *cb)
47{
48 if (!strcmp(var, FSMONITOR__IPC_THREADS)) {
49 int i = git_config_int(var, value, ctx->kvi);
50 if (i < 1)
51 return error(_("value of '%s' out of range: %d"),
52 FSMONITOR__IPC_THREADS, i);
53 fsmonitor__ipc_threads = i;
54 return 0;
55 }
56
57 if (!strcmp(var, FSMONITOR__START_TIMEOUT)) {
58 int i = git_config_int(var, value, ctx->kvi);
59 if (i < 0)
60 return error(_("value of '%s' out of range: %d"),
61 FSMONITOR__START_TIMEOUT, i);
62 fsmonitor__start_timeout_sec = i;
63 return 0;
64 }
65
66 if (!strcmp(var, FSMONITOR__ANNOUNCE_STARTUP)) {
67 int is_bool;
68 int i = git_config_bool_or_int(var, value, ctx->kvi, &is_bool);
69 if (i < 0)
70 return error(_("value of '%s' not bool or int: %d"),
71 var, i);
72 fsmonitor__announce_startup = i;
73 return 0;
74 }
75
76 return git_default_config(var, value, ctx, cb);
77}
78
79/*
80 * Acting as a CLIENT.

Callers

nothing calls this directly

Calls 4

git_config_intFunction · 0.85
errorFunction · 0.85
git_config_bool_or_intFunction · 0.85
git_default_configFunction · 0.85

Tested by

no test coverage detected