From: Andrew Chitester <andchi@fastmail•com>
To: andchi@fastmail•com
Cc: git@vger•kernel.org
Subject: [GSoC PATCH v2 1/1] t1420: modernize the lost-found test
Date: Tue, 6 Jan 2026 08:26:58 -0500 [thread overview]
Message-ID: <20260106132658.798706-1-andchi@fastmail.com> (raw)
In-Reply-To: <20260104161536.45384-1-andchi@fastmail.com>
This test indirectly checks that the lost-found folder has 2 files in it
and then checks that the expected two files exist. Make this more
deliberate by removing the old test -f and compare the actual ls of the
lost-found directory with the expected files.
Signed-off-by: Andrew Chitester <andchi@fastmail•com>
---
t/t1420-lost-found.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/t/t1420-lost-found.sh b/t/t1420-lost-found.sh
index 2fb2f44f02..926c6d63e3 100755
--- a/t/t1420-lost-found.sh
+++ b/t/t1420-lost-found.sh
@@ -28,9 +28,12 @@ test_expect_success 'lost and found something' '
test_tick &&
git reset --hard HEAD^ &&
git fsck --lost-found &&
- test 2 = $(ls .git/lost-found/*/* | wc -l) &&
- test -f .git/lost-found/commit/$(cat lost-commit) &&
- test -f .git/lost-found/other/$(cat lost-other)
+ ls .git/lost-found/*/* >actual &&
+ cat >expect <<-EOF &&
+ .git/lost-found/commit/$(cat lost-commit)
+ .git/lost-found/other/$(cat lost-other)
+ EOF
+ test_cmp expect actual
'
test_done
--
2.52.0
prev parent reply other threads:[~2026-01-06 13:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-04 16:15 [GSoC PATCH] t1420-lost-found.sh: use test_path_is_file for error logging Andrew Chitester
2026-01-05 3:24 ` Junio C Hamano
2026-01-08 1:30 ` Andrew Chitester
2026-01-06 13:26 ` Andrew Chitester [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260106132658.798706-1-andchi@fastmail.com \
--to=andchi@fastmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox