summaryrefslogtreecommitdiff
path: root/t/t1300-config.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-03 16:28:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-05 23:30:03 (GMT)
commitdde154b5bd84e6258b496498901eb24b4914ec6b (patch)
tree41a7048cf5d0b31a362cb960dc305479d07543ad /t/t1300-config.sh
parent85bf5d61e717f79f7ac68d15e336e54293035405 (diff)
downloadgit-dde154b5bd84e6258b496498901eb24b4914ec6b.zip
git-dde154b5bd84e6258b496498901eb24b4914ec6b.tar.gz
git-dde154b5bd84e6258b496498901eb24b4914ec6b.tar.bz2
t1300: remove unreasonable expectation from TODO
In https://public-inbox.org/git/7vvc8alzat.fsf@alter.siamese.dyndns.org/ a reasonable patch was made quite a bit less so by changing a test case demonstrating a bug to a test case that demonstrates that we ask for too much: the test case 'unsetting the last key in a section removes header' now expects a future bug fix to be able to determine whether a free-form comment above a section header refers to said section or not. Rather than shooting for the stars (and not even getting off the ground), let's start shooting for something obtainable and be reasonably confident that we *can* get it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1300-config.sh')
-rwxr-xr-xt/t1300-config.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 05c011e..3ab83ff 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -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 &&