Subject: Re: [PATCH 06/12] t: prepare execution of potentially failing commands for `set -e`

From: Junio C Hamano <[email-masked]>
Date: Mon, 13 Apr 2026 15:32:02 -0700

Patrick Steinhardt <[email-masked]> writes:

> diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
> index 2fde2353fd..07d86ea244 100644
> --- a/t/lib-git-svn.sh
> +++ b/t/lib-git-svn.sh
> @@ -15,8 +15,7 @@ GIT_SVN_DIR=$GIT_DIR/svn/refs/remotes/git-svn
>  SVN_TREE=$GIT_SVN_DIR/svn-tree
>  test_set_port SVNSERVE_PORT
>  
> -svn >/dev/null 2>&1
> -if test $? -ne 1
> +if ! svn help >/dev/null 2>&1
>  then
>  	skip_all='skipping git svn tests, svn not found'
>  	test_done

I think I know what is lacking in this patch.  Following the above
section (which is a good conversion), there is this bit that needs a
similar handling.

 t/lib-git-svn.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git c/t/lib-git-svn.sh w/t/lib-git-svn.sh
index 2fde2353fd..24c15d17eb 100644
--- c/t/lib-git-svn.sh
+++ w/t/lib-git-svn.sh
@@ -27,13 +27,13 @@ export svnrepo
 svnconf=$PWD/svnconf
 export svnconf
 
+x=0
 perl -w -e "
 use SVN::Core;
 use SVN::Repos;
 \$SVN::Core::VERSION gt '1.1.0' or exit(42);
 system(qw/svnadmin create --fs-type fsfs/, \$ENV{svnrepo}) == 0 or exit(41);
-" >&3 2>&4
-x=$?
+" >&3 2>&4 || x=$?
 if test $x -ne 0
 then
 	if test $x -eq 42; then