aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-07-27 15:01:36 -0700
committerJunio C Hamano <gitster@pobox.com>2010-07-27 15:01:36 -0700
commite5498e8a9f9a596ecff78426bbf904626cd7863a (patch)
tree0d8f2d6df322847817a42cc371c78984125a3190 /t
parentc4818faf81d32d940c58ab209f83b6049b33ecbb (diff)
parent593ce2bea5dad436e87b5dd37c205961d73feae9 (diff)
downloadgit-e5498e8a9f9a596ecff78426bbf904626cd7863a.tar.gz
git-e5498e8a9f9a596ecff78426bbf904626cd7863a.tar.xz
Sync with 1.7.0 series
Diffstat (limited to 't')
-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 f11f98c3c..7ddab5fb7 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"