Re: [GSoC PATCH] t1420-lost-found.sh: use test_path_is_file for error logging
- From
- Andrew Chitester <andchi@fastmail.com>
- Date
- Jan 8, 2026, 01:30 UTC
- Message-ID
- <87v7hcvqk1.fsf@fastmail.com>
- In-Reply-To
- <xmqq4ip0n3mm.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> Looks correct, but given that what these tests want to ensure is > that underneath .git/lost-found there are only these two expected > files, I have to wonder if the output of "ls" here is expected to be > very stable. I.e. if we rewrote the whole thing to something like > ... > > 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 > > ... would it be a more direct way to say that and is easier to > understand to our readers.
Thanks for the feedback. This is an elegant solution that I did not consider. Looking through the other tests, I am seeing this similar pattern of comparing an expected result with the actual result. It is much more deliberate and readable this way. I sent a v2, as a reply to my original message, but I think I forgot to Cc you in that message. I'm still figuring out the email workflow.