git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] t7412: modernize path checks to use test helper functions

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 4, 2026, 05:16 UTC
Message-ID
<aafAKc41y4CdZmUt@pks.im>
In-Reply-To
<20260303175750.361563-2-ysinghcin@gmail.com>
On Tue, Mar 03, 2026 at 11:27:50PM +0530, Yuvraj Singh Chauhan wrote:
> Replace 11 raw 'test -f', 'test -d', and '! test -e' calls with the

This explicit number of course made me verify that you didn't miscount, and you indeed didn't :)

Show 9 quoted lines
> corresponding test library helpers:
> 
>   - 'test -f' -> 'test_path_is_file'
>   - 'test -d' -> 'test_path_is_dir'
>   - '! test -e' -> 'test_path_is_missing'
> 
> These helpers emit a descriptive message on failure, 
> making failing tests easier to diagnose than the silent 
> pass/fail of the raw shell primitives.
Yup, the reasoning is sound.

By the way, you have trailing whitespace in the commit message. I guess it'll get stripped when Junio applies the patch anyway, but maybe something to watch out for in the future.

> diff --git a/t/t7412-submodule-absorbgitdirs.sh b/t/t7412-submodule-absorbgitdirs.sh
> index 41ee035e3c..cdc7f59e12 100755
> --- a/t/t7412-submodule-absorbgitdirs.sh
> +++ b/t/t7412-submodule-absorbgitdirs.sh
The changes all look obviously correct to me. Thanks!
Patrick
Previous: Yuvraj Singh ChauhanNext: Patrick Steinhardt
Message 3 of 4 in “t7412: fix typo 'submodue' in test_description”
  1. 1/2 t7412: fix typo 'submodue' in test_descriptionYuvraj Singh Chauhan, Mar 3, 2026
  2. 2/2 t7412: modernize path checks to use test helper functionsYuvraj Singh Chauhan, Mar 3, 2026
  3. Patrick SteinhardtMar 4, 2026
  4. Patrick SteinhardtMar 4, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.