t1300: `--unset-all` can leave an empty section behind (bug)
[gitweb.git] / t / t1300-config.sh
index a59c07fcb74c83d77377436f7d0864fe37ff13d7..8a3cd2c11416643af32c184bfee7bd53c6213005 100755 (executable)
@@ -1472,6 +1472,17 @@ test_expect_failure '--unset last key removes section (except if commented)' '
        test_line_count = 3 .git/config
 '
 
+test_expect_failure '--unset-all removes section if empty & uncommented' '
+       cat >.git/config <<-\EOF &&
+       [section]
+       key = value1
+       key = value2
+       EOF
+
+       git config --unset-all section.key &&
+       test_line_count = 0 .git/config
+'
+
 test_expect_failure 'adding a key into an empty section reuses header' '
        cat >.git/config <<-\EOF &&
        [section]