diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-07-27 16:54:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-07-27 16:55:05 -0700 |
commit | ba9523ea809dc496a14f3644bdc1dd6f486983c0 (patch) | |
tree | 13109340ff2bd55bd16271bbad7a9232f9052923 /t | |
parent | 9a3028b987d73e4c85e8db9980720feba6a1b5c6 (diff) | |
parent | 2aedccd3d51ec922020f7c7e39df5d2c4d3af515 (diff) | |
download | git-ba9523ea809dc496a14f3644bdc1dd6f486983c0.tar.gz |
Sync with 1.7.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t1300-repo-config.sh | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 64f05080b6..074f2f2e3e 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -707,19 +707,41 @@ test_expect_success 'set --path' ' git config --path path.trailingtilde "foo~" && test_cmp expect .git/config' +if test "${HOME+set}" +then + test_set_prereq HOMEVAR +fi + cat >expect <<EOF $HOME/ /dev/null foo~ EOF -test_expect_success 'get --path' ' +test_expect_success HOMEVAR '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 ' +cat >expect <<\EOF +/dev/null +foo~ +EOF + +test_expect_success 'get --path copes with unset $HOME' ' + ( + unset HOME; + test_must_fail git config --get --path path.home \ + >result 2>msg && + git config --get --path path.normal >>result && + git config --get --path path.trailingtilde >>result + ) && + grep "[Ff]ailed to expand.*~/" msg && + test_cmp expect result +' + rm .git/config git config quote.leading " test" |