Code

Merge branch 'master' of git://repo.or.cz/git-gui
[git.git] / t / t1300-repo-config.sh
index 84a59397b2427615165a243f2fd53e81ee8f8ce9..a1d777ca81456fb737b9f02effe7ff02c53645ad 100755 (executable)
@@ -391,6 +391,41 @@ EOF
 
 test_expect_success "rename succeeded" "git diff expect .git/config"
 
+cat >> .git/config << EOF
+  [branch "zwei"] a = 1 [branch "vier"]
+EOF
+
+test_expect_success "remove section" "git config --remove-section branch.zwei"
+
+cat > expect << EOF
+# Hallo
+       #Bello
+[branch "drei"]
+weird
+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 &&