Skip to content

Commit 9b777a1

Browse files
committed
cvs tests: do not touch test CVS repositories shipped with source
Some tests in t96xx series (cvsimport) want to write into the control area (CVSROOT) of their test CVS repositories, but this does not work well when the source area is made read-only (test trash directories are moved via --root=else/where option). Copy the supplied test CVS repository to a scratch place at the beginning of these tests. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 06eaaa7 commit 9b777a1

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

t/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ pre-clean:
2929

3030
clean:
3131
$(RM) -r 'trash directory'.* test-results
32-
$(RM) t????/cvsroot/CVSROOT/?*
3332
$(RM) -r valgrind/bin
3433
$(RM) .prove
3534

t/lib-cvs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ case "$cvsps_version" in
3030
;;
3131
esac
3232

33+
setup_cvs_test_repository () {
34+
CVSROOT="$(pwd)/.cvsroot" &&
35+
cp -r "$TEST_DIRECTORY/$1/cvsroot" "$CVSROOT" &&
36+
export CVSROOT
37+
}
38+
3339
test_cvs_co () {
3440
# Usage: test_cvs_co BRANCH_NAME
3541
rm -rf module-cvs-"$1"

t/t9601-cvsimport-vendor-branch.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@
3434
test_description='git cvsimport handling of vendor branches'
3535
. ./lib-cvs.sh
3636

37-
test_expect_success PERL 'setup CVSROOT' '
38-
CVSROOT="$TEST_DIRECTORY"/t9601/cvsroot &&
39-
export CVSROOT
40-
'
37+
setup_cvs_test_repository t9601
4138

4239
test_expect_success PERL 'import a module with a vendor branch' '
4340

t/t9602-cvsimport-branches-tags.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
test_description='git cvsimport handling of branches and tags'
77
. ./lib-cvs.sh
88

9-
test_expect_success PERL 'setup CVSROOT' '
10-
CVSROOT="$TEST_DIRECTORY"/t9602/cvsroot &&
11-
export CVSROOT
12-
'
9+
setup_cvs_test_repository t9602
1310

1411
test_expect_success PERL 'import module' '
1512

t/t9603-cvsimport-patchsets.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
test_description='git cvsimport testing for correct patchset estimation'
1515
. ./lib-cvs.sh
1616

17-
CVSROOT="$TEST_DIRECTORY"/t9603/cvsroot
18-
export CVSROOT
17+
setup_cvs_test_repository t9603
1918

2019
test_expect_failure 'import with criss cross times on revisions' '
2120

0 commit comments

Comments
 (0)