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

Function die_missing_set_value

builtin/config.c:214–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214static NORETURN void die_missing_set_value(const char *arg)
215{
216 const char *last_dot = strrchr(arg, '.');
217 const char *eq = last_dot ? strchr(last_dot + 1, '=') : NULL;
218 char *prefix = eq ? xstrndup(arg, eq - arg) : NULL;
219
220 if (prefix && git_config_key_is_valid(prefix)) {
221 error(_("missing value to set to the variable '%s'"), arg);
222 advise(_("did you mean \"git config set %s %s\"?"),
223 prefix, eq + 1);
224 } else if (git_config_key_is_valid(arg)) {
225 error(_("missing value to set to the variable '%s'"), arg);
226 } else {
227 error(_("missing value to set to a variable with an invalid name '%s'"),
228 arg);
229 }
230 free(prefix);
231 exit(129);
232}
233
234static void show_config_origin(const struct config_display_options *opts,
235 const struct key_value_info *kvi,

Callers 2

cmd_config_setFunction · 0.85
cmd_config_actionsFunction · 0.85

Calls 4

xstrndupFunction · 0.85
git_config_key_is_validFunction · 0.85
errorFunction · 0.85
adviseFunction · 0.85

Tested by

no test coverage detected