Avoid a test failure when the test wants to skip itself.
[pspp] / tests / test-vc-list-files-cvs.sh
index c94932fc27e03e55d3c6325deece583a03d3d007..c87267cde358c1a7e85e65a464e91176e35486c5 100755 (executable)
@@ -44,7 +44,8 @@ for i in with-cvsu without; do
   ok=0
   mkdir $tmpdir && cd $tmpdir &&
     # without cvs, skip the test
-    { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 || exit 77; } &&
+    # The double use of 'exit' is needed for the reference to $? inside the trap.
+    { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 || { (exit 77); exit 77; }; } &&
     mkdir w && cd w &&
     mkdir d &&
     touch d/a b c &&