Merge branch 'ps/config-env-pairs'
Introduce two new ways to feed configuration variable-value pairs via environment variables, and tweak the way GIT_CONFIG_PARAMETERS encodes variable/value pairs to make it more robust. * ps/config-env-pairs: config: allow specifying config entries via envvar pairs environment: make `getenv_safe()` a public function config: store "git -c" variables using more robust format config: parse more robust format in GIT_CONFIG_PARAMETERS config: extract function to parse config pairs quote: make sq_dequote_step() a public function config: add new way to pass config via `--config-env` git: add `--super-prefix` to usage string
This commit is contained in:
3
git.c
3
git.c
@ -29,6 +29,7 @@ const char git_usage_string[] =
|
||||
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
|
||||
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n"
|
||||
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
|
||||
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
|
||||
" <command> [<args>]");
|
||||
|
||||
const char git_more_info_string[] =
|
||||
@ -254,6 +255,8 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
|
||||
git_config_push_parameter((*argv)[1]);
|
||||
(*argv)++;
|
||||
(*argc)--;
|
||||
} else if (skip_prefix(cmd, "--config-env=", &cmd)) {
|
||||
git_config_push_env(cmd);
|
||||
} else if (!strcmp(cmd, "--literal-pathspecs")) {
|
||||
setenv(GIT_LITERAL_PATHSPECS_ENVIRONMENT, "1", 1);
|
||||
if (envchanged)
|
||||
|
||||
Reference in New Issue
Block a user