summaryrefslogtreecommitdiff
path: root/t/t1300-config.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-09 08:32:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-09 12:32:59 (GMT)
commitc71d8bb38a73abc910a63bf7a81f3869dc9c2f34 (patch)
tree7af39fce0f5084545c41c94f1bca58ff5d0c67a8 /t/t1300-config.sh
parent22aedfccd0cfe7c8f09a990cf4777efc7f27bd2e (diff)
downloadgit-c71d8bb38a73abc910a63bf7a81f3869dc9c2f34.zip
git-c71d8bb38a73abc910a63bf7a81f3869dc9c2f34.tar.gz
git-c71d8bb38a73abc910a63bf7a81f3869dc9c2f34.tar.bz2
git_config_set: reuse empty sections
It can happen quite easily that the last setting in a config section is removed, and to avoid confusion when there are comments in the config about that section, we keep a lone section header, i.e. an empty section. Now that we use the `event_fn` callback, it is easy to add support for re-using empty sections, so let's do that. Note: t5512-ls-remote requires that this change is applied *after* the patch "git config --unset: remove empty sections (in the common case)": without that patch, there would be empty `transfer` and `uploadpack` sections ready for reuse, but in the *wrong* order (and sconsequently, t5512's "overrides work between mixed transfer/upload-pack hideRefs" would fail). 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.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 92aaa53..e43982a 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1483,7 +1483,7 @@ test_expect_success '--unset-all removes section if empty & uncommented' '
test_line_count = 0 .git/config
'
-test_expect_failure 'adding a key into an empty section reuses header' '
+test_expect_success 'adding a key into an empty section reuses header' '
cat >.git/config <<-\EOF &&
[section]
EOF