summaryrefslogtreecommitdiff
path: root/t/t1300-config.sh
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-08-08 19:50:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-08 20:26:48 (GMT)
commit2d84f13dcb67762c2506e71232556e196f32600b (patch)
tree52dbde7d3b1ef1a4e7793ce623d441078c70a016 /t/t1300-config.sh
parent999d90262727a8e7a25a40dd71073040a2605437 (diff)
downloadgit-2d84f13dcb67762c2506e71232556e196f32600b.zip
git-2d84f13dcb67762c2506e71232556e196f32600b.tar.gz
git-2d84f13dcb67762c2506e71232556e196f32600b.tar.bz2
config: fix case sensitive subsection names on writing
A user reported a submodule issue regarding a section mix-up, but it could be boiled down to the following test case: $ git init test && cd test $ git config foo."Bar".key test $ git config foo."bar".key test $ tail -n 3 .git/config [foo "Bar"] key = test key = test Sub sections are case sensitive and we have a test for correctly reading them. However we do not have a test for writing out config correctly with case sensitive subsection names, which is why this went unnoticed in 6ae996f2acf (git_config_set: make use of the config parser's event stream, 2018-04-09) Unfortunately we have to make a distinction between old style configuration that looks like [foo.Bar] key = test and the new quoted style as seen above. The old style is documented as case-agnostic, hence we need to keep 'strncasecmp'; although the resulting setting for the old style config differs from the configuration. That will be fixed in a follow up patch. Reported-by: JP Sugarbroad <jpsugar@google.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1300-config.sh')
-rwxr-xr-xt/t1300-config.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index c15c19b..77c5899 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1260,6 +1260,7 @@ test_expect_success 'setting different case sensitive subsections ' '
Qc = v2
[d "e"]
f = v1
+ [d "E"]
Qf = v2
EOF
# exact match