Code

git-add -u paths... now works from subdirectory
[git.git] / t / t1300-repo-config.sh
index 78c2e0864f56ecf39e8738e8fecec9ca8dd4e8a2..f1a78b19ac6e426f4475b66cfe23b89e41c7fafa 100755 (executable)
@@ -283,6 +283,12 @@ EOF
 test_expect_success 'get variable with no value' \
        'git-config --get novalue.variable ^$'
 
+echo novalue.variable > expect
+
+test_expect_success 'get-regexp variable with no value' \
+       'git-config --get-regexp novalue > output &&
+        cmp output expect'
+
 git-config > output 2>&1
 
 test_expect_success 'no arguments, but no crash' \
@@ -407,6 +413,25 @@ EOF
 test_expect_success "section was removed properly" \
        "git diff -u expect .git/config"
 
+rm .git/config
+
+cat > expect << EOF
+[gitcvs]
+       enabled = true
+       dbname = %Ggitcvs2.%a.%m.sqlite
+[gitcvs "ext"]
+       dbname = %Ggitcvs1.%a.%m.sqlite
+EOF
+
+test_expect_success 'section ending' '
+
+       git-config gitcvs.enabled true &&
+       git-config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite &&
+       git-config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite &&
+       cmp .git/config expect
+
+'
+
 test_expect_success numbers '
 
        git-config kilo.gram 1k &&
@@ -417,6 +442,40 @@ test_expect_success numbers '
        test z1048576 = "z$m"
 '
 
+cat > expect << EOF
+true
+false
+true
+false
+true
+false
+true
+false
+EOF
+
+test_expect_success bool '
+
+       git-config bool.true1 01 &&
+       git-config bool.true2 -1 &&
+       git-config bool.true3 YeS &&
+       git-config bool.true4 true &&
+       git-config bool.false1 000 &&
+       git-config bool.false2 "" &&
+       git-config bool.false3 nO &&
+       git-config bool.false4 FALSE &&
+       rm -f result &&
+       for i in 1 2 3 4
+       do
+           git-config --bool --get bool.true$i >>result
+           git-config --bool --get bool.false$i >>result
+        done &&
+       cmp expect result'
+
+test_expect_failure 'invalid bool' '
+
+       git-config bool.nobool foobar &&
+       git-config --bool --get bool.nobool'
+
 rm .git/config
 
 git-config quote.leading " test"