t9200: handle missing CVS with skip_all
CVS initialization runs outside a test_expect_success and when it fails, the error report isn't good. Wrap CVS initialization in a skip_all check so when CVS initialization fails, the error report becomes clearer. Move the Git repo initialization into its own test_expect_success instead of being in the same CVS check. Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pablo Sabater committed
Mar 11, 2026 at 20:40 UTC
6523589a2c034de168f6240d040e0910f7aeddda
1 file changed
+11
-7
t/t9200-git-cvsexportcommit.sh
+11
-7
@@ -30,13 +30,17 @@ export CVSROOT CVSWORK GIT_DIR
30
31
rm -rf "$CVSROOT" "$CVSWORK"
32
33
-cvs init &&
34
-test -d "$CVSROOT" &&
35
-cvs -Q co -d "$CVSWORK" . &&
36
-echo >empty &&
37
-git add empty &&
38
-git commit -q -a -m "Initial" 2>/dev/null ||
39
-exit 1
33
+if ! cvs init || ! test -d "$CVSROOT" || ! cvs -Q co -d "$CVSWORK" .
34
+then
35
+ skip_all="cvs repository set-up fails"
36
+ test_done
37
+fi
38
+
39
+test_expect_success 'git setup' '
40
+ echo >empty &&
41
+ git add empty &&
42
+ git commit -q -a -m Initial
43
+'
44
45
check_entries () {
46
# $1 == directory, $2 == expected