summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-01-25 22:19:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-25 22:19:19 (GMT)
commit294e949fa2dfd43097b2b5614470a3e43604663d (patch)
tree05965a5fb1413fbf6c896aa8494338af676228c4 /git.c
parent7eefa1349bcba7f4bb533f6e04f472c27b16ea83 (diff)
parentd8d77153eafdb0fc334e827976f09e4bdff26b58 (diff)
downloadgit-294e949fa2dfd43097b2b5614470a3e43604663d.zip
git-294e949fa2dfd43097b2b5614470a3e43604663d.tar.gz
git-294e949fa2dfd43097b2b5614470a3e43604663d.tar.bz2
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
Diffstat (limited to 'git.c')
-rw-r--r--git.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/git.c b/git.c
index a00a0a4..b5f63d3 100644
--- a/git.c
+++ b/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)