From 1349484e341a3ec2ba02a86c8fbd97ea9dc8c756 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Wed, 30 Dec 2009 17:51:53 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- t/t1300-repo-config.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 't') 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 < 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" -- cgit v1.2.3