summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-02-17 17:21:43 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-02-17 17:21:43 -0800
commit483e09e810796786baf7a9139680f6d2f2470829 (patch)
tree41a503f778c0140db8dc565a94aa6f23869efad8 /t
parentMerge branch 'js/reflog-expire-stale-fix' (diff)
parentconfig: improve error message for boolean config (diff)
downloadtgif-483e09e810796786baf7a9139680f6d2f2470829.tar.xz
Merge branch 'ak/config-bad-bool-error'
The error message given when a configuration variable that is expected to have a boolean value has been improved. * ak/config-bad-bool-error: config: improve error message for boolean config
Diffstat (limited to 't')
-rwxr-xr-xt/t1300-config.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 936d72041b..e0dd5d65ce 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -675,6 +675,13 @@ test_expect_success 'invalid unit' '
test_i18ngrep "bad numeric config value .1auto. for .aninvalid.unit. in file .git/config: invalid unit" actual
'
+test_expect_success 'invalid unit boolean' '
+ git config commit.gpgsign "1true" &&
+ test_cmp_config 1true commit.gpgsign &&
+ test_must_fail git config --bool --get commit.gpgsign 2>actual &&
+ test_i18ngrep "bad boolean config value .1true. for .commit.gpgsign." actual
+'
+
test_expect_success 'line number is reported correctly' '
printf "[bool]\n\tvar\n" >invalid &&
test_must_fail git config -f invalid --path bool.var 2>actual &&