MCPcopy Index your code
hub / github.com/git/git / git_config_push_env

Function git_config_push_env

config.c:502–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500}
501
502void 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
526static inline int iskeychar(int c)
527{

Callers 1

handle_optionsFunction · 0.85

Calls 3

xmemdupzFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected