Re: [PATCH 3/4] contrib/subtree: convert subtree type check to use case statement
From: Jeff King <hidden>
Date: 2023-11-09 18:56:44
From: Jeff King <hidden>
Date: 2023-11-09 18:56:44
On Thu, Nov 09, 2023 at 11:53:39AM +0100, Patrick Steinhardt wrote:
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