Re: [PATCH 3/4] contrib/subtree: convert subtree type check to use case statement
On Thu, Nov 09, 2023 at 11:53:39AM +0100, Patrick Steinhardt wrote:
Show 7 quoted lines
> The `subtree_for_commit ()` helper function asserts that the subtree
> identified by its parameters are either a commit or tree. This is done
> via the `-o` parameter of test, which is discouraged.
>
> Refactor the code to instead use a switch statement over the type.
> Despite being aligned with our coding guidelines, the resulting code is
> arguably also easier to read.
Yes, I'd agree that the result is much easier to follow.
-Peff