aboutsummaryrefslogtreecommitdiff
path: root/t/t1300-repo-config.sh
diff options
context:
space:
mode:
authorBrian Gernhardt <benji@silverinsanity.com>2007-01-09 00:27:41 -0500
committerJunio C Hamano <junkio@cox.net>2007-01-08 22:00:18 -0800
commitcdd4fb15cf06ec1de588bee4576509857d8e2cb4 (patch)
tree83341bf9b9b28007f2d92a344b0c1cb7df0e54c2 /t/t1300-repo-config.sh
parentbaee1e91ed41cd369ca3ddd63615b64feaa0286f (diff)
downloadgit-cdd4fb15cf06ec1de588bee4576509857d8e2cb4.tar.gz
git-cdd4fb15cf06ec1de588bee4576509857d8e2cb4.tar.xz
Auto-quote config values in config.c:store_write_pair()
Suggested by Jakub Narebski <jnareb@gmail.com> on the list. When we send a value to store_write_pair(), make sure that the value that gets read out matches the one passed in. This means that for any value that contains leading or trailing whitespace or any comment character (# and ;), we need to surround it in quotes. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t1300-repo-config.sh')
-rwxr-xr-xt/t1300-repo-config.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index a29caa06d..60acdd368 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -401,5 +401,22 @@ test_expect_success numbers '
test z1048576 = "z$m"
'
+rm .git/config
+
+git-repo-config quote.leading " test"
+git-repo-config quote.ending "test "
+git-repo-config quote.semicolon "test;test"
+git-repo-config quote.hash "test#test"
+
+cat > expect << EOF
+[quote]
+ leading = " test"
+ ending = "test "
+ semicolon = "test;test"
+ hash = "test#test"
+EOF
+
+test_expect_success 'quoting' 'cmp .git/config expect'
+
test_done