Skip to content

Commit a25907d

Browse files
Junio HamanoJunio C Hamano
authored andcommitted
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 <[email protected]>
1 parent 02851e0 commit a25907d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

t/t9400-git-cvsserver-server.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
2626
unset GIT_DIR GIT_CONFIG
2727
WORKDIR=$(pwd)
2828
SERVERDIR=$(pwd)/gitcvs.git
29+
git_config="$SERVERDIR/config"
2930
CVSROOT=":fork:$SERVERDIR"
30-
CVSWORK=$(pwd)/cvswork
31+
CVSWORK="$(pwd)/cvswork"
3132
CVS_SERVER=git-cvsserver
3233
export CVSROOT CVS_SERVER
3334

@@ -43,7 +44,7 @@ echo >empty &&
4344
# note that cvs doesn't accept absolute pathnames
4445
# as argument to co -d
4546
test_expect_success 'basic checkout' \
46-
'cvs -Q co -d cvswork master &&
47+
'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
4748
test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5))" = "empty/1.1/"'
4849

4950
test_expect_success 'cvs update (create new file)' \
@@ -52,7 +53,7 @@ test_expect_success 'cvs update (create new file)' \
5253
git commit -q -m "Add testfile1" &&
5354
git push gitcvs.git >/dev/null &&
5455
cd cvswork &&
55-
cvs -Q update &&
56+
GIT_CONFIG="$git_config" cvs -Q update &&
5657
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
5758
diff -q testfile1 ../testfile1'
5859

@@ -63,7 +64,7 @@ test_expect_success 'cvs update (update existing file)' \
6364
git commit -q -m "Append to testfile1" &&
6465
git push gitcvs.git >/dev/null &&
6566
cd cvswork &&
66-
cvs -Q update &&
67+
GIT_CONFIG="$git_config" cvs -Q update &&
6768
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
6869
diff -q testfile1 ../testfile1'
6970

@@ -76,7 +77,7 @@ test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" \
7677
git commit -q -m "Single Subdirectory" &&
7778
git push gitcvs.git >/dev/null &&
7879
cd cvswork &&
79-
cvs -Q update &&
80+
GIT_CONFIG="$git_config" cvs -Q update &&
8081
test ! -d test'
8182

8283
cd "$WORKDIR"
@@ -89,7 +90,7 @@ test_expect_success 'cvs update (subdirectories)' \
8990
git commit -q -m "deep sub directory structure" &&
9091
git push gitcvs.git >/dev/null &&
9192
cd cvswork &&
92-
cvs -Q update -d &&
93+
GIT_CONFIG="$git_config" cvs -Q update -d &&
9394
(for dir in A A/B A/B/C A/D E; do
9495
filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
9596
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)' \
107108
git commit -q -m "Remove testfile1" &&
108109
git push gitcvs.git >/dev/null &&
109110
cd cvswork &&
110-
cvs -Q update &&
111+
GIT_CONFIG="$git_config" cvs -Q update &&
111112
test -z "$(grep testfile1 CVS/Entries)" &&
112113
test ! -f testfile1'
113114

@@ -118,7 +119,7 @@ test_expect_success 'cvs update (re-add deleted file)' \
118119
git commit -q -m "Re-Add testfile1" &&
119120
git push gitcvs.git >/dev/null &&
120121
cd cvswork &&
121-
cvs -Q update &&
122+
GIT_CONFIG="$git_config" cvs -Q update &&
122123
test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
123124
diff -q testfile1 ../testfile1'
124125

0 commit comments

Comments
 (0)