aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/t1300-repo-config.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index a786c5c97..66aeb88db 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -283,17 +283,40 @@ test_expect_success '--add' \
cat > .git/config << EOF
[novalue]
variable
+[emptyvalue]
+ variable =
EOF
test_expect_success 'get variable with no value' \
'git config --get novalue.variable ^$'
+test_expect_success 'get variable with empty value' \
+ 'git config --get emptyvalue.variable ^$'
+
echo novalue.variable > expect
test_expect_success 'get-regexp variable with no value' \
'git config --get-regexp novalue > output &&
cmp output expect'
+echo 'emptyvalue.variable ' > expect
+
+test_expect_success 'get-regexp variable with empty value' \
+ 'git config --get-regexp emptyvalue > output &&
+ cmp output expect'
+
+echo true > expect
+
+test_expect_success 'get bool variable with no value' \
+ 'git config --bool novalue.variable > output &&
+ cmp output expect'
+
+echo false > expect
+
+test_expect_success 'get bool variable with empty value' \
+ 'git config --bool emptyvalue.variable > output &&
+ cmp output expect'
+
git config > output 2>&1
test_expect_success 'no arguments, but no crash' \