[PATCH] Add a test for git-config --file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 t/t1300-repo-config.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
From a5ae18f299d431053074c0ebdcf2d96a3ac9dff6 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@xxxxxxxxx>
Date: Tue, 31 Jul 2007 12:30:52 +0200
Subject: [PATCH] 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@xxxxxxxxx>
---
 t/t1300-repo-config.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 187ca2d..1d2bf2c 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
-- 
1.5.3.rc3.132.g39179


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux