Subject: Re: [PATCH 06/11] tests: make svn test "set -e" clean

From: Patrick Steinhardt <[email-masked]>
Date: Wed, 25 Mar 2026 08:15:54 +0100

On Tue, Mar 24, 2026 at 11:21:09PM -0700, Junio C Hamano wrote:
> diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
> index 2fde2353fd..a73b997f8f 100644
> --- a/t/lib-git-svn.sh
> +++ b/t/lib-git-svn.sh
> @@ -15,8 +15,8 @@ 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
> +x=0; svn >/dev/null 2>&1 || x=$?
> +if test $x -ne 1
>  then
>  	skip_all='skipping git svn tests, svn not found'
>  	test_done

An alternative:

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

Patrick