From: Alex Riesen Date: Tue, 31 Jul 2007 10:30:52 +0000 (+0200) Subject: Add a test for git-config --file X-Git-Tag: v1.5.3-rc4~27 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=773a69fb09acfdfa2ce5566548d8a8a370a59fde;p=git.git Add a test for git-config --file Check for non-0 exit code if the confiog file does not exist and if it works exactly like when setting GIT_CONFIG. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 187ca2df5..1d2bf2c06 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -325,6 +325,9 @@ EOF test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect' +test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' \ + 'git config --file non-existing-config -l; test $? != 0' + cat > other-config << EOF [ein] bahn = strasse @@ -338,6 +341,9 @@ GIT_CONFIG=other-config git config -l > output test_expect_success 'alternative GIT_CONFIG' 'cmp output expect' +test_expect_success 'alternative GIT_CONFIG (--file)' \ + 'git config --file other-config -l > output && cmp output expect' + GIT_CONFIG=other-config git config anwohner.park ausweis cat > expect << EOF