| 500 | } |
| 501 | |
| 502 | void git_config_push_env(const char *spec) |
| 503 | { |
| 504 | char *key; |
| 505 | const char *env_name; |
| 506 | const char *env_value; |
| 507 | |
| 508 | env_name = strrchr(spec, '='); |
| 509 | if (!env_name) |
| 510 | die(_("invalid config format: %s"), spec); |
| 511 | key = xmemdupz(spec, env_name - spec); |
| 512 | env_name++; |
| 513 | if (!*env_name) |
| 514 | die(_("missing environment variable name for configuration '%.*s'"), |
| 515 | (int)(env_name - spec - 1), spec); |
| 516 | |
| 517 | env_value = getenv(env_name); |
| 518 | if (!env_value) |
| 519 | die(_("missing environment variable '%s' for configuration '%.*s'"), |
| 520 | env_name, (int)(env_name - spec - 1), spec); |
| 521 | |
| 522 | git_config_push_split_parameter(key, env_value); |
| 523 | free(key); |
| 524 | } |
| 525 | |
| 526 | static inline int iskeychar(int c) |
| 527 | { |
no test coverage detected