@matheusbsbs / matheus-bagliano / commits / a25907dac4
Fork 0

t9400: Use the repository config and nothing else.

git-cvsserver has a bug in its configuration file output parser that makes it choke if the configuration has these: [diff] color = auto [diff.color] whitespace = blue reverse This needs to be fixed, but thanks to that bug, a separate bug in t9400 test script was discovered. The test discarded GIT_CONFIG instead of pointing at the proper one to be used in the exoprted repository. This allowed user's .gitconfig and (if exists) systemwide /etc/gitconfig to affect the outcome of the test, which is a big no-no. The patch fixes the problem in the test. Fixing the git-cvsserver's configuration parser is left as an exercise to motivated volunteers ;-) Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio Hamano committed May 11, 2007 at 16:35 UTC a25907dac4a3b79523290f19232157b9705dfe55
1 file changed +9 -8
t/t9400-git-cvsserver-server.sh
+9 -8
@@ -26,8 +26,9 @@ perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
26 unset GIT_DIR GIT_CONFIG
27 WORKDIR=$(pwd)
28 SERVERDIR=$(pwd)/gitcvs.git
29 +git_config="$SERVERDIR/config"
30 CVSROOT=":fork:$SERVERDIR"
30 -CVSWORK=$(pwd)/cvswork
31 +CVSWORK="$(pwd)/cvswork"
32 CVS_SERVER=git-cvsserver
33 export CVSROOT CVS_SERVER
34
@@ -43,7 +44,7 @@ echo >empty &&
44 # note that cvs doesn't accept absolute pathnames
45 # as argument to co -d
46 test_expect_success 'basic checkout' \
46 - 'cvs -Q co -d cvswork master &&
47 + 'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
48 test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5))" = "empty/1.1/"'
49
50 test_expect_success 'cvs update (create new file)' \
@@ -52,7 +53,7 @@ test_expect_success 'cvs update (create new file)' \
53 git commit -q -m "Add testfile1" &&
54 git push gitcvs.git >/dev/null &&
55 cd cvswork &&
55 - cvs -Q update &&
56 + GIT_CONFIG="$git_config" cvs -Q update &&
57 test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
58 diff -q testfile1 ../testfile1'
59
@@ -63,7 +64,7 @@ test_expect_success 'cvs update (update existing file)' \
64 git commit -q -m "Append to testfile1" &&
65 git push gitcvs.git >/dev/null &&
66 cd cvswork &&
66 - cvs -Q update &&
67 + GIT_CONFIG="$git_config" cvs -Q update &&
68 test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
69 diff -q testfile1 ../testfile1'
70
@@ -76,7 +77,7 @@ test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" \
77 git commit -q -m "Single Subdirectory" &&
78 git push gitcvs.git >/dev/null &&
79 cd cvswork &&
79 - cvs -Q update &&
80 + GIT_CONFIG="$git_config" cvs -Q update &&
81 test ! -d test'
82
83 cd "$WORKDIR"
@@ -89,7 +90,7 @@ test_expect_success 'cvs update (subdirectories)' \
90 git commit -q -m "deep sub directory structure" &&
91 git push gitcvs.git >/dev/null &&
92 cd cvswork &&
92 - cvs -Q update -d &&
93 + GIT_CONFIG="$git_config" cvs -Q update -d &&
94 (for dir in A A/B A/B/C A/D E; do
95 filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
96 if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
@@ -107,7 +108,7 @@ test_expect_success 'cvs update (delete file)' \
108 git commit -q -m "Remove testfile1" &&
109 git push gitcvs.git >/dev/null &&
110 cd cvswork &&
110 - cvs -Q update &&
111 + GIT_CONFIG="$git_config" cvs -Q update &&
112 test -z "$(grep testfile1 CVS/Entries)" &&
113 test ! -f testfile1'
114
@@ -118,7 +119,7 @@ test_expect_success 'cvs update (re-add deleted file)' \
119 git commit -q -m "Re-Add testfile1" &&
120 git push gitcvs.git >/dev/null &&
121 cd cvswork &&
121 - cvs -Q update &&
122 + GIT_CONFIG="$git_config" cvs -Q update &&
123 test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
124 diff -q testfile1 ../testfile1'
125