summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-05-07 03:47:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-07 03:47:37 (GMT)
commit5f586f55a02b98d7a2a9c770d33e8170ca563e43 (patch)
tree8996793f2c451ce84549cf710ce4a0b783124eac /t
parent7e391989789db82983665667013a46eabc6fc570 (diff)
parentc331551ccf9a4c8922ff5d2987eed9e218479000 (diff)
downloadgit-5f586f55a02b98d7a2a9c770d33e8170ca563e43.zip
git-5f586f55a02b98d7a2a9c770d33e8170ca563e43.tar.gz
git-5f586f55a02b98d7a2a9c770d33e8170ca563e43.tar.bz2
Merge branch 'ps/config-env-option-with-separate-value'
"git --config-env var=val cmd" weren't accepted (only --config-env=var=val was). * ps/config-env-option-with-separate-value: git: support separate arg for `--config-env`'s value git.txt: fix synopsis of `--config-env` missing the equals sign
Diffstat (limited to 't')
-rwxr-xr-xt/t1300-config.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index e0dd5d6..ad4e6d0 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1374,16 +1374,29 @@ test_expect_success 'git --config-env=key=envvar support' '
cat >expect <<-\EOF &&
value
value
+ value
+ value
+ false
false
EOF
{
ENVVAR=value git --config-env=core.name=ENVVAR config core.name &&
+ ENVVAR=value git --config-env core.name=ENVVAR config core.name &&
ENVVAR=value git --config-env=foo.CamelCase=ENVVAR config foo.camelcase &&
- ENVVAR= git --config-env=foo.flag=ENVVAR config --bool foo.flag
+ ENVVAR=value git --config-env foo.CamelCase=ENVVAR config foo.camelcase &&
+ ENVVAR= git --config-env=foo.flag=ENVVAR config --bool foo.flag &&
+ ENVVAR= git --config-env foo.flag=ENVVAR config --bool foo.flag
} >actual &&
test_cmp expect actual
'
+test_expect_success 'git --config-env with missing value' '
+ test_must_fail env ENVVAR=value git --config-env 2>error &&
+ grep "no config key given for --config-env" error &&
+ test_must_fail env ENVVAR=value git --config-env config core.name 2>error &&
+ grep "invalid config format: config" error
+'
+
test_expect_success 'git --config-env fails with invalid parameters' '
test_must_fail git --config-env=foo.flag config --bool foo.flag 2>error &&
test_i18ngrep "invalid config format: foo.flag" error &&