]> git.ipfire.org Git - thirdparty/git.git/commit
t7611: replace test -f with test_path_is* helpers
authorMeet Soni <meetsoni3017@gmail.com>
Fri, 27 Dec 2024 10:53:45 +0000 (16:23 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Dec 2024 16:13:59 +0000 (08:13 -0800)
commitcef3d4a89f8d21fae6669822cbb540927020d93b
tree7d900eec37af18ab308487772b75430feece7365
parent76cf4f61c87855ebf0784b88aaf737d6b09f504b
t7611: replace test -f with test_path_is* helpers

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` checks 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."

Replace these cases with `test_path_is_missing` for better
debuggability.

Helped-by: karthik nayak <karthik.188@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7611-merge-abort.sh