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 <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alex Riesen committed
Jul 31, 2007 at 12:30 UTC
773a69fb09acfdfa2ce5566548d8a8a370a59fde
1 file changed
+6
t/t1300-repo-config.sh
+6
@@ -325,6 +325,9 @@ EOF
325
326
test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect'
327
328
+test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' \
329
+ 'git config --file non-existing-config -l; test $? != 0'
330
+
331
cat > other-config << EOF
332
[ein]
333
bahn = strasse
@@ -338,6 +341,9 @@ GIT_CONFIG=other-config git config -l > output
341
342
test_expect_success 'alternative GIT_CONFIG' 'cmp output expect'
343
344
+test_expect_success 'alternative GIT_CONFIG (--file)' \
345
+ 'git config --file other-config -l > output && cmp output expect'
346
+
347
GIT_CONFIG=other-config git config anwohner.park ausweis
348
349
cat > expect << EOF