{"thread":{"id":"11930","subject":"[PATCH] config: add test cases for empty value and no value config variables.","startedAt":"2008-02-07T05:23:46Z","lastAt":"2008-02-07T05:23:46Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"67751","messageId":"20080207062346.3936cc53.chriscool@tuxfamily.org","threadId":"11930","inReplyTo":null,"subject":"[PATCH] config: add test cases for empty value and no value config variables.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-02-07T05:23:46Z","receivedAt":"2008-02-07T05:23:46Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"The tests in 't1300-repo-config.sh' did not check what happens when\nan empty value like the following is used in the config file:\n\n[emptyvalue]\n\tvariable =\n\nAlso it was not checked that a variable with no value like the\nfollowing:\n\n[novalue]\n\tvariable\n\ngives a boolean \"true\" value, while an ampty value gives a boolean\n\"false\" value.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n t/t1300-repo-config.sh |   23 +++++++++++++++++++++++\n 1 files changed, 23 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex a786c5c..66aeb88 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -283,17 +283,40 @@ test_expect_success '--add' \\\n cat > .git/config << EOF\n [novalue]\n \tvariable\n+[emptyvalue]\n+\tvariable =\n EOF\n \n test_expect_success 'get variable with no value' \\\n \t'git config --get novalue.variable ^$'\n \n+test_expect_success 'get variable with empty value' \\\n+\t'git config --get emptyvalue.variable ^$'\n+\n echo novalue.variable > expect\n \n test_expect_success 'get-regexp variable with no value' \\\n \t'git config --get-regexp novalue > output &&\n \t cmp output expect'\n \n+echo 'emptyvalue.variable ' > expect\n+\n+test_expect_success 'get-regexp variable with empty value' \\\n+\t'git config --get-regexp emptyvalue > output &&\n+\t cmp output expect'\n+\n+echo true > expect\n+\n+test_expect_success 'get bool variable with no value' \\\n+\t'git config --bool novalue.variable > output &&\n+\t cmp output expect'\n+\n+echo false > expect\n+\n+test_expect_success 'get bool variable with empty value' \\\n+\t'git config --bool emptyvalue.variable > output &&\n+\t cmp output expect'\n+\n git config > output 2>&1\n \n test_expect_success 'no arguments, but no crash' \\\n-- \n1.5.4.18.gd0b8\n"}]}