Skip to content

Commit

Permalink
Add a test for git-config --file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed Aug 1, 2007
1 parent 67d454f commit 773a69f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions t/t1300-repo-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 773a69f

Please sign in to comment.