t1300: remove unreasonable expectation from TODO
[gitweb.git] / t / t1300-config.sh
index 05c011ee032cf2ede0ca9e38fd2e49ebfd024070..3ab83fff8f54d662778e4f1115d2ec86d0484c95 100755 (executable)
@@ -1390,7 +1390,7 @@ test_expect_success 'urlmatch with wildcard' '
 '
 
 # good section hygiene
-test_expect_failure 'unsetting the last key in a section removes header' '
+test_expect_failure '--unset last key removes section (except if commented)' '
        cat >.git/config <<-\EOF &&
        # some generic comment on the configuration file itself
        # a comment specific to this "section" section.
@@ -1404,6 +1404,25 @@ test_expect_failure 'unsetting the last key in a section removes header' '
 
        cat >expect <<-\EOF &&
        # some generic comment on the configuration file itself
+       # a comment specific to this "section" section.
+       [section]
+       # some intervening lines
+       # that should also be dropped
+
+       # please be careful when you update the above variable
+       EOF
+
+       git config --unset section.key &&
+       test_cmp expect .git/config &&
+
+       cat >.git/config <<-\EOF &&
+       [section]
+       key = value
+       [next-section]
+       EOF
+
+       cat >expect <<-\EOF &&
+       [next-section]
        EOF
 
        git config --unset section.key &&