提交 773a69fb 编写于 作者: A Alex Riesen 提交者: Junio C Hamano

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: NAlex Riesen <raa.lkml@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 67d454fe
...@@ -325,6 +325,9 @@ EOF ...@@ -325,6 +325,9 @@ EOF
test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect' 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 cat > other-config << EOF
[ein] [ein]
bahn = strasse bahn = strasse
...@@ -338,6 +341,9 @@ GIT_CONFIG=other-config git config -l > output ...@@ -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' '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 GIT_CONFIG=other-config git config anwohner.park ausweis
cat > expect << EOF cat > expect << EOF
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册