diff --git a/tests/test-dispatch b/tests/test-dispatch
index b0e3d3973440889da117b719097bb97fce36d918_dGVzdHMvdGVzdC1kaXNwYXRjaA==..6a5e159eb93ed120407e533bda4eceb0cf7f0435_dGVzdHMvdGVzdC1kaXNwYXRjaA== 100755
--- a/tests/test-dispatch
+++ b/tests/test-dispatch
@@ -22,8 +22,8 @@
 hg cat a
 
 echo '% working directory removed'
-rm -rf $dir/a
-hg --version
+sh -c "cd $dir && rm -rf a"
+hg --version 2>&1 | sed -e 's,\(abort:.*:\).*$,\1 ...,g'
 
 echo '% no repo'
 cd $dir
diff --git a/tests/test-dispatch.out b/tests/test-dispatch.out
index b0e3d3973440889da117b719097bb97fce36d918_dGVzdHMvdGVzdC1kaXNwYXRjaC5vdXQ=..6a5e159eb93ed120407e533bda4eceb0cf7f0435_dGVzdHMvdGVzdC1kaXNwYXRjaC5vdXQ= 100644
--- a/tests/test-dispatch.out
+++ b/tests/test-dispatch.out
@@ -34,6 +34,6 @@
 a
 a: No such file in rev 000000000000
 % working directory removed
-abort: error getting current working directory: No such file or directory
+abort: error getting current working directory: ...
 % no repo
 abort: There is no Mercurial repository here (.hg not found)!