Subject: Re: [PATCH v4 0/4] fix die_if_checked_out() when ignore_current_worktree

From: Junio C Hamano <[email-masked]>
Date: Sat, 25 Feb 2023 14:50:07 -0800

Rubén Justo <[email-masked]> writes:

>      +	test_when_finished "
>     -+		git worktree remove wt1 &&
>     -+		git worktree remove wt2 &&
>     -+		git branch -d shared
>     -+		git checkout -
>     ++		git worktree remove wt1 ||:
>     ++		git worktree remove wt2 ||:
>     ++		git checkout - ||:
>     ++		git branch -D shared ||:
>      +	" &&

Sorry, but I do not get the point of this construct.  The
test_cleanup variable that accumulates test_when_finished scripts is
evaled without -e shopt set, so you can just remove all these ||:
and add a single "true" at the end, like

	...
	git checkout -
	git branch -D shared
	:
    " &&

for exactly the same effect, no?