Merge branch 'maint'
[gitweb.git] / t / t1300-repo-config.sh
index ee386cfbf3be4d457644103b223e1fcafaa363ba..3f3fd2d7f7cc148948a20e47cccd06751b9a2241 100755 (executable)
@@ -368,12 +368,12 @@ cat > expect << EOF
 weird
 EOF
 
-test_expect_success "rename succeeded" "diff -u expect .git/config"
+test_expect_success "rename succeeded" "git diff expect .git/config"
 
 test_expect_failure "rename non-existing section" \
        'git-config --rename-section branch."world domination" branch.drei'
 
-test_expect_success "rename succeeded" "diff -u expect .git/config"
+test_expect_success "rename succeeded" "git diff expect .git/config"
 
 test_expect_success "rename another section" \
        'git-config --rename-section branch."1 234 blabl/a" branch.drei'
@@ -389,7 +389,7 @@ cat > expect << EOF
 weird
 EOF
 
-test_expect_success "rename succeeded" "diff -u expect .git/config"
+test_expect_success "rename succeeded" "git diff expect .git/config"
 
 cat >> .git/config << EOF
   [branch "zwei"] a = 1 [branch "vier"]
@@ -405,7 +405,26 @@ weird
 EOF
 
 test_expect_success "section was removed properly" \
-       "diff -u expect .git/config"
+       "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 '
 
@@ -417,6 +436,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"