{"thread":{"id":"60305","subject":"[PATCH] t4014: replace \"test -f\" with \"test_path_is_file\"","startedAt":"2023-10-05T14:25:55Z","lastAt":"2023-10-05T14:25:55Z","messageCount":1,"participants":["Vinayak Dev"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"482682","messageId":"20231005071134.43747-1-vinayakdev.sci@gmail.com","threadId":"60305","inReplyTo":null,"subject":"[PATCH] t4014: replace \"test -f\" with \"test_path_is_file\"","fromName":"Vinayak Dev","fromEmail":"vinayakdev.sci@gmail.com","sentAt":"2023-10-05T07:11:34Z","receivedAt":"2023-10-05T14:25:55Z","isPatch":true,"sender":{"key":"vinayakdev.sci@gmail.com","avatar":"https://avatars.githubusercontent.com/u/104419489?v=4"},"body":"From: Vinayak Dev <vinayakdev.sci@gmail.com>\n\nMany tests in the codebase use test -[e|f|d].. commands\nto check for various conditions. However, the test command\nupon failure simply exits with a non-zero exit code(usually 1).\nTherefore, replace instances of \"test -f\" from t/t4014-format-patch.sh\nwith the function test_path_is_file() defined in t/test-lib-functions.sh\nthat exits with a debugging-friendly diagnostic message upon failure.\n\nSigned-off-by: Vinayak Dev <vinayakdev.sci@gmail.com>\n---\n t/t4014-format-patch.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 0a4ab36c3a..5f7d0836d6 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -763,7 +763,7 @@ test_expect_success 'format-patch from a subdirectory (1)' '\n \t\tfalse\n \t\t;;\n \tesac &&\n-\ttest -f \"$filename\"\n+\ttest_path_is_file \"$filename\"\n '\n \n test_expect_success 'format-patch from a subdirectory (2)' '\n@@ -782,7 +782,7 @@ test_expect_success 'format-patch from a subdirectory (2)' '\n \t\t;;\n \tesac &&\n \tbasename=$(expr \"$filename\" : \".*/\\(.*\\)\") &&\n-\ttest -f \"sub/$basename\"\n+\ttest_path_is_file \"sub/$basename\"\n '\n \n test_expect_success 'format-patch from a subdirectory (3)' '\n@@ -794,7 +794,7 @@ test_expect_success 'format-patch from a subdirectory (3)' '\n \t\tgit format-patch -1 -o \"$TRASH_DIRECTORY\"\n \t) &&\n \tbasename=$(expr \"$filename\" : \".*/\\(.*\\)\") &&\n-\ttest -f \"$basename\"\n+\ttest_path_is_file \"$basename\"\n '\n \n test_expect_success 'format-patch --in-reply-to' '\n\nbase-commit: d0e8084c65cbf949038ae4cc344ac2c2efd77415\n-- \n2.41.0\n\n"}]}