From 4c0a89fcde219df8db8fdb9635ef2ef40d002a6e Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 25 Apr 2012 08:00:36 -0400 Subject: config: expand tildes in include.path variable You can already use relative paths in include.path, which means that including "foo" from your global "~/.gitconfig" will look in your home directory. However, you might want to do something clever like putting "~/.gitconfig-foo" in a specific repository's config file. Signed-off-by: Jeff King Acked-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t1305-config-include.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 't/t1305-config-include.sh') diff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh index 4b1cbaa028..a70707620f 100755 --- a/t/t1305-config-include.sh +++ b/t/t1305-config-include.sh @@ -29,6 +29,14 @@ test_expect_success 'chained relative paths' ' test_cmp expect actual ' +test_expect_success 'include paths get tilde-expansion' ' + echo "[test]one = 1" >one && + echo "[include]path = ~/one" >.gitconfig && + echo 1 >expect && + git config test.one >actual && + test_cmp expect actual +' + test_expect_success 'include options can still be examined' ' echo "[test]one = 1" >one && echo "[include]path = one" >.gitconfig && -- cgit v1.2.3