From: Stefan Beller Date: Wed, 8 Aug 2018 19:50:19 +0000 (-0700) Subject: config: fix case sensitive subsection names on writing X-Git-Tag: v2.19.0-rc0~7^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2d84f13dcb67762c2506e71232556e196f32600b?ds=inline;hp=2d84f13dcb67762c2506e71232556e196f32600b 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 Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano ---