Re: [PATCH] t5315: use test_path_is_file for loose-object check
- From
Pablo <pabloosabaterr@gmail.com>
- Date
- Mar 19, 2026, 16:26 UTC
- Message-ID
- <CAN5EUNR2mqpCMG0oPsDnzgZr-2yyL+S0A7p_MM62F7d4MjBuSA@mail.gmail.com>
- In-Reply-To
- <20260319160301.98039-1-elkhatabibilal@gmail.com>
Bilal El Khatabi (<elkhatabibilal@gmail.com>) writes:
> > From: bilalobe <elkhatabibilal@gmail.com>
I see this is sent from Bilal El Khatabi and From has a different name, How do you want to be known in the community? PS: from Documentation/SubmittingPatches: "It is common, but not required, to use some form of your real name. We realize that some contributors are not comfortable doing so or prefer to contribute under a pseudonym or preferred name and we can accept your patch either way, as long as the name and email you use are distinctive, identifying, and not misleading."
> > Replace an assertion-style `test -f` check with `test_path_is_file` > in `t/t5315-pack-objects-compression.sh`.
Try explaining why is this change needed
> This aligns the test with the path-checking helpers used in Git's test > suite.
It would help to explain why this is better than what was before, for example that this helper reports loudly what expectation wasn't met, therefore makes it easier to debug.
> Found with: > git grep "test -[efd]" t/
Many are adding this prob because it is said on the microproject to add the command you used to find the file, but because this is just one instance, it's not very useful. It's better to drop it.
Seeing that this is a microproject and the current date, if this is for GSoC, add to the subject GSoC with PATCH "[GSoC PATCH]" for example, and CC your possible co mentors.
Show 17 quoted lines
> Signed-off-by: bilalobe <elkhatabibilal@gmail.com> > --- > t/t5315-pack-objects-compression.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/t/t5315-pack-objects-compression.sh b/t/t5315-pack-objects-compression.sh > index 8bacd96275..d0feab17b4 100755 > --- a/t/t5315-pack-objects-compression.sh > +++ b/t/t5315-pack-objects-compression.sh > @@ -10,7 +10,7 @@ test_expect_success setup ' > # make sure it resulted in a loose object > ob=$(sed -e "s/\(..\).*/\1/" object-name) && > ject=$(sed -e "s/..\(.*\)/\1/" object-name) && > - test -f .git/objects/$ob/$ject > + test_path_is_file .git/objects/$ob/$ject > ' >
Code seems fine
Show 5 quoted lines
> while read expect config > -- > 2.53.0 > >