Thread (5 messages) 5 messages, 3 authors, 2024-12-27

Re: [PATCH v3] t7611: replace test -f with test_path_is* helpers

From: Ghanshyam Thakkar <hidden>
Date: 2024-12-27 12:19:23

On Fri Dec 27, 2024 at 4:23 PM IST, Meet Soni wrote:
Replace `test -f` and `test ! -f` with `test_path_is_file` and
`test_path_is_missing` for better debuggability.

While `test -f` ensures that the file exists and is a regular file,
`test_path_is_file` provides clearer error messages on failure. On the
other hand, `test ! -f`, used to check either the absence of a regular
file or the presence of any other filesystem object, but looking at
them in the test individually, all of them should've said `test ! e`,
i.e. "there shouldn't be anything at given path on filesystem."
Replaced these cases with `test_path_is_missing` for better
debuggability.
'Replaced' -> 'Replace'. Cf. https://git-scm.com/docs/SubmittingPatches#imperative-mood

Other than that, this LGTM.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help