Skip to content

Commit dde154b

Browse files
dschogitster
authored andcommitted
t1300: remove unreasonable expectation from TODO
In https://public-inbox.org/git/[email protected]/ 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 85bf5d6 commit dde154b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

t/t1300-config.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ test_expect_success 'urlmatch with wildcard' '
13901390
'
13911391

13921392
# good section hygiene
1393-
test_expect_failure 'unsetting the last key in a section removes header' '
1393+
test_expect_failure '--unset last key removes section (except if commented)' '
13941394
cat >.git/config <<-\EOF &&
13951395
# some generic comment on the configuration file itself
13961396
# a comment specific to this "section" section.
@@ -1404,6 +1404,25 @@ test_expect_failure 'unsetting the last key in a section removes header' '
14041404
14051405
cat >expect <<-\EOF &&
14061406
# some generic comment on the configuration file itself
1407+
# a comment specific to this "section" section.
1408+
[section]
1409+
# some intervening lines
1410+
# that should also be dropped
1411+
1412+
# please be careful when you update the above variable
1413+
EOF
1414+
1415+
git config --unset section.key &&
1416+
test_cmp expect .git/config &&
1417+
1418+
cat >.git/config <<-\EOF &&
1419+
[section]
1420+
key = value
1421+
[next-section]
1422+
EOF
1423+
1424+
cat >expect <<-\EOF &&
1425+
[next-section]
14071426
EOF
14081427
14091428
git config --unset section.key &&

0 commit comments

Comments
 (0)