summaryrefslogtreecommitdiffstats
path: root/t/t0068-for-each-repo.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-04-06 22:38:28 +0200
committerJunio C Hamano <gitster@pobox.com>2023-04-06 22:38:29 +0200
commit87daf40750c9e344dd50495fdca1809aebcb1a94 (patch)
tree3f08482461e3484d5e77c7575c3fa35af28a33a4 /t/t0068-for-each-repo.sh
parentMerge branch 'ps/fetch-ref-update-reporting' (diff)
parentfor-each-repo: with bad config, don't conflate <path> and <cmd> (diff)
downloadgit-87daf40750c9e344dd50495fdca1809aebcb1a94.tar.xz
git-87daf40750c9e344dd50495fdca1809aebcb1a94.zip
Merge branch 'ab/config-multi-and-nonbool'
Assorted config API updates. * ab/config-multi-and-nonbool: for-each-repo: with bad config, don't conflate <path> and <cmd> config API: add "string" version of *_value_multi(), fix segfaults config API users: test for *_get_value_multi() segfaults for-each-repo: error on bad --config config API: have *_multi() return an "int" and take a "dest" versioncmp.c: refactor config reading next commit config API: add and use a "git_config_get()" family of functions config tests: add "NULL" tests for *_get_value_multi() config tests: cover blind spots in git_die_config() tests
Diffstat (limited to 't/t0068-for-each-repo.sh')
-rwxr-xr-xt/t0068-for-each-repo.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t0068-for-each-repo.sh b/t/t0068-for-each-repo.sh
index 3648d439a8..4b90b74d5d 100755
--- a/t/t0068-for-each-repo.sh
+++ b/t/t0068-for-each-repo.sh
@@ -40,4 +40,23 @@ test_expect_success 'do nothing on empty config' '
git for-each-repo --config=bogus.config -- help --no-such-option
'
+test_expect_success 'error on bad config keys' '
+ test_expect_code 129 git for-each-repo --config=a &&
+ test_expect_code 129 git for-each-repo --config=a.b. &&
+ test_expect_code 129 git for-each-repo --config="'\''.b"
+'
+
+test_expect_success 'error on NULL value for config keys' '
+ cat >>.git/config <<-\EOF &&
+ [empty]
+ key
+ EOF
+ cat >expect <<-\EOF &&
+ error: missing value for '\''empty.key'\''
+ EOF
+ test_expect_code 129 git for-each-repo --config=empty.key 2>actual.raw &&
+ grep ^error actual.raw >actual &&
+ test_cmp expect actual
+'
+
test_done