diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2009-07-30 15:41:57 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-07-31 19:38:30 +0400 |
commit | ebdaae372b460ffdf5d153dcd0ac235d52b0d2ce (patch) | |
tree | e0e54f0f661802b8a13f2c84a329d774643132c8 /t/t1300-repo-config.sh | |
parent | e276f018f2c1f0fc962fbe44a36708d1cdebada8 (diff) |
config: Keep inner whitespace verbatim
Configuration values are expected to be quoted when they have leading or
trailing whitespace, but inner whitespace should be kept verbatim even if
the value is not quoted. This is already documented in git-config(1), but
the code caused inner whitespace to be collapsed to a single space,
breaking, for example, clones from a path that has two consecutive spaces
in it, as future fetches would only see a single space.
Reported-by: John te Bokkel <tanj.tanj@gmail.com>
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1300-repo-config.sh')
-rwxr-xr-x | t/t1300-repo-config.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 43ea283242..91cbd551d8 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -733,6 +733,11 @@ echo >>result test_expect_success '--null --get-regexp' 'cmp result expect' +test_expect_success 'inner whitespace kept verbatim' ' + git config section.val "foo bar" && + test "z$(git config section.val)" = "zfoo bar" +' + test_expect_success SYMLINKS 'symlinked configuration' ' ln -s notyet myconfig && |