{"thread":{"id":"64771","subject":"[PATCH] t1420: use test helpers for lost-found checks","startedAt":"2026-01-11T14:39:33Z","lastAt":"2026-01-11T14:50:15Z","messageCount":2,"participants":["Pushkar Singh"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"533527","messageId":"20260111143928.37604-1-pushkarkumarsingh1970@gmail.com","threadId":"64771","inReplyTo":null,"subject":"[PATCH] t1420: use test helpers for lost-found checks","fromName":"Pushkar Singh","fromEmail":"pushkarkumarsingh1970@gmail.com","sentAt":"2026-01-11T14:38:33Z","receivedAt":"2026-01-11T14:39:33Z","isPatch":true,"sender":{"key":"pushkarkumarsingh1970@gmail.com","avatar":"https://avatars.githubusercontent.com/u/173247767?v=4"},"body":"The lost-found test used raw `test -f` and `ls | wc -l` checks.\nReplace them with `test_path_is_file` and `test_line_count` to provide\nclearer failure diagnostics and keep the test consistent with the\nrest of the test suite.\n\nSigned-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n---\n t/t1420-lost-found.sh | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t1420-lost-found.sh b/t/t1420-lost-found.sh\nindex 2fb2f44f02..da1e48d35e 100755\n--- a/t/t1420-lost-found.sh\n+++ b/t/t1420-lost-found.sh\n@@ -28,9 +28,10 @@ test_expect_success 'lost and found something' '\n \ttest_tick &&\n \tgit reset --hard HEAD^ &&\n \tgit fsck --lost-found &&\n-\ttest 2 = $(ls .git/lost-found/*/* | wc -l) &&\n-\ttest -f .git/lost-found/commit/$(cat lost-commit) &&\n-\ttest -f .git/lost-found/other/$(cat lost-other)\n+\tls .git/lost-found/*/* >actual &&\n+\ttest_line_count = 2 actual &&\n+\ttest_path_is_file .git/lost-found/commit/$(cat lost-commit) &&\n+\ttest_path_is_file .git/lost-found/other/$(cat lost-other)\n '\n \n test_done\n-- \n2.43.0\n\n"},{"id":"533528","messageId":"CALE2CrRJdNVVc+f5RR4yXBgsuYfGXSPaHUAA3qyLrkM3Met6wA@mail.gmail.com","threadId":"64771","inReplyTo":"20260111143928.37604-1-pushkarkumarsingh1970@gmail.com","subject":"Re: [PATCH] t1420: use test helpers for lost-found checks","fromName":"Pushkar Singh","fromEmail":"pushkarkumarsingh1970@gmail.com","sentAt":"2026-01-11T14:50:03Z","receivedAt":"2026-01-11T14:50:15Z","isPatch":true,"sender":{"key":"pushkarkumarsingh1970@gmail.com","avatar":"https://avatars.githubusercontent.com/u/173247767?v=4"},"body":"I noticed that this test is already being worked on and reviewed in\nanother thread. I’ll drop this patch to avoid duplication.\n\nThanks,\nPushkar\n\nOn Sun, Jan 11, 2026 at 8:09 PM Pushkar Singh\n<pushkarkumarsingh1970@gmail.com> wrote:\n>\n> The lost-found test used raw `test -f` and `ls | wc -l` checks.\n> Replace them with `test_path_is_file` and `test_line_count` to provide\n> clearer failure diagnostics and keep the test consistent with the\n> rest of the test suite.\n>\n> Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>\n> ---\n>  t/t1420-lost-found.sh | 7 ++++---\n>  1 file changed, 4 insertions(+), 3 deletions(-)\n>\n> diff --git a/t/t1420-lost-found.sh b/t/t1420-lost-found.sh\n> index 2fb2f44f02..da1e48d35e 100755\n> --- a/t/t1420-lost-found.sh\n> +++ b/t/t1420-lost-found.sh\n> @@ -28,9 +28,10 @@ test_expect_success 'lost and found something' '\n>         test_tick &&\n>         git reset --hard HEAD^ &&\n>         git fsck --lost-found &&\n> -       test 2 = $(ls .git/lost-found/*/* | wc -l) &&\n> -       test -f .git/lost-found/commit/$(cat lost-commit) &&\n> -       test -f .git/lost-found/other/$(cat lost-other)\n> +       ls .git/lost-found/*/* >actual &&\n> +       test_line_count = 2 actual &&\n> +       test_path_is_file .git/lost-found/commit/$(cat lost-commit) &&\n> +       test_path_is_file .git/lost-found/other/$(cat lost-other)\n>  '\n>\n>  test_done\n> --\n> 2.43.0\n>\n"}]}