Re: [PATCH 19/21] t/helper: remove dependency on `the_repository` in "oidtree"
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 12, 2024, 07:38 UTC
- Message-ID
- <ZmlQhSr_nCM-O7IT@tanuki>
- In-Reply-To
- <ZmjbJU1Rnnx0ggHt@tapette.crustytoothpaste.net>
On Tue, Jun 11, 2024 at 11:17:57PM +0000, brian m. carlson wrote:
Show 16 quoted lines
> On 2024-06-11 at 11:59:01, Patrick Steinhardt wrote:
> > diff --git a/t/helper/test-oidtree.c b/t/helper/test-oidtree.c
> > index c7a1d4c642..04ec24cc84 100644
> > --- a/t/helper/test-oidtree.c
> > +++ b/t/helper/test-oidtree.c
> > @@ -30,7 +27,7 @@ int cmd__oidtree(int argc UNUSED, const char **argv UNUSED)
> > algo = oid.algo;
> > oidtree_insert(&ot, &oid);
> > } else if (skip_prefix(line.buf, "contains ", &arg)) {
> > - if (get_oid_hex(arg, &oid))
> > + if (get_oid_hex_any(arg, &oid) == GIT_HASH_UNKNOWN)
> > die("contains not a hexadecimal oid: %s", arg);
>
> This is not a problem in your code, but this might read more naturally
> as "does not contain a hexadecimal oid" or "contains no hexadecimal
> oid".True. I'll leave this as-is though given that Ghanshyam is already busy converting this test to be a unit test anyway, so I don't want to make his life harder here.
Patrick