summaryrefslogtreecommitdiff
path: root/t/t1300-repo-config.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-07-27 16:40:15 -0700
committerJunio C Hamano <gitster@pobox.com>2010-07-27 16:40:23 -0700
commit33a0292e612915320e56f392b3372589f602a9e6 (patch)
treed89cb548433f7964b4a7e76256aacb8752853133 /t/t1300-repo-config.sh
parent49bb1f2ac6b6e5c7113241e066545802e5a14c9c (diff)
parent245b10ca1b0ff21de42b12ee2c1e3c9f8d1d98a3 (diff)
downloadgit-33a0292e612915320e56f392b3372589f602a9e6.tar.gz
Sync with 1.7.1.2
Diffstat (limited to 't/t1300-repo-config.sh')
-rwxr-xr-xt/t1300-repo-config.sh24
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"