diff options
author | Matthieu Moy <Matthieu.Moy@imag.fr> | 2009-12-30 17:51:53 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-12-31 12:19:38 -0800 |
commit | 1349484e341a3ec2ba02a86c8fbd97ea9dc8c756 (patch) | |
tree | 5c2d753daa7234da64de974c1badcc4973b35e79 /t/t1300-repo-config.sh | |
parent | 902f235378cb2b2f6dd5dd664b9630c95321f0ae (diff) | |
download | git-1349484e341a3ec2ba02a86c8fbd97ea9dc8c756.tar.gz |
builtin-config: add --path option doing ~ and ~user expansion.
395de250 (Expand ~ and ~user in core.excludesfile, commit.template)
introduced a C function git_config_pathname, doing ~/ and ~user/
expansion. This patch makes the feature available to scripts with 'git
config --get --path'.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
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 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 83b7294010..f89d7e9e49 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -683,6 +683,34 @@ test_expect_success 'set --bool-or-int' ' rm .git/config +cat >expect <<\EOF +[path] + home = ~/ + normal = /dev/null + trailingtilde = foo~ +EOF + +test_expect_success 'set --path' ' + git config --path path.home "~/" && + git config --path path.normal "/dev/null" && + git config --path path.trailingtilde "foo~" && + test_cmp expect .git/config' + +cat >expect <<EOF +$HOME/ +/dev/null +foo~ +EOF + +test_expect_success 'get --path' ' + git config --get --path path.home > result && + git config --get --path path.normal >> result && + git config --get --path path.trailingtilde >> result && + test_cmp expect result +' + +rm .git/config + git config quote.leading " test" git config quote.ending "test " git config quote.semicolon "test;test" |