| 212 | } |
| 213 | |
| 214 | static 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 | |
| 234 | static void show_config_origin(const struct config_display_options *opts, |
| 235 | const struct key_value_info *kvi, |
no test coverage detected