Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-09 11:32:02 +0300
committerJunio C Hamano <gitster@pobox.com>2018-04-09 15:32:58 +0300
commitb73bdc34c06358359750a896983a2ea85b694ca0 (patch)
tree311064e15702bd725a5145c693e1dab756827080 /t/t1300-config.sh
parent422e8ef26d35a7e54d5b7b990669f4a525cb8828 (diff)
t1300: `--unset-all` can leave an empty section behind (bug)
We already have a test demonstrating that removing the last entry from a config section fails to remove the section header of the now-empty section. The same can happen, of course, if we remove the last entries in one fell swoop. This is *also* a bug, and should be fixed at the same time. 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.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index a59c07fcb7..8a3cd2c114 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -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]