Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Add a test for git-config --file
author
Alex Riesen
<raa.lkml@gmail.com>
Tue, 31 Jul 2007 10:30:52 +0000
(12:30 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 1 Aug 2007 05:56:15 +0000
(22:56 -0700)
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>
t/t1300-repo-config.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
67d454f
)
diff --git
a/t/t1300-repo-config.sh
b/t/t1300-repo-config.sh
index 187ca2df5c81245256630428d3fc47567e0b4112..1d2bf2c06087546503b7272a9547ab8232b017d4 100755
(executable)
--- 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 '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
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' '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
GIT_CONFIG=other-config git config anwohner.park ausweis
cat > expect << EOF