aboutsummaryrefslogtreecommitdiff
path: root/t/t1303-wacky-config.sh
diff options
context:
space:
mode:
authorBryan Donlan <bdonlan@fushizen.net>2008-05-04 01:37:52 -0400
committerJunio C Hamano <gitster@pobox.com>2008-05-05 14:17:00 -0700
commite5c349ba112fc53832c757cef122297718d3a175 (patch)
treebfd7760127650321edd298cae96f8bc663141822 /t/t1303-wacky-config.sh
parent97b88dd58cad9d60427af9a956f90f7803f55db8 (diff)
downloadgit-e5c349ba112fc53832c757cef122297718d3a175.tar.gz
git-e5c349ba112fc53832c757cef122297718d3a175.tar.xz
config.c: Escape backslashes in section names properly
If an element of the configuration key name other than the first or last contains a backslash, it is not escaped on output, but is treated as an escape sequence on input. Thus, the backslash is lost when re-loading the configuration. This patch corrects this by having backslashes escaped properly, and introduces a new test for this bug. Signed-off-by: Bryan Donlan <bdonlan@fushizen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1303-wacky-config.sh')
-rwxr-xr-xt/t1303-wacky-config.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh
index 99985dcd7..f366b53fb 100755
--- a/t/t1303-wacky-config.sh
+++ b/t/t1303-wacky-config.sh
@@ -34,4 +34,10 @@ test_expect_success 'add key in different section' '
check section2.key bar
'
+SECTION="test.q\"s\\sq'sp e.key"
+test_expect_success 'make sure git-config escapes section names properly' '
+ git config "$SECTION" bar &&
+ check "$SECTION" bar
+'
+
test_done