Re: [PATCH v4 5/8] list-objects: implement object type filter
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Apr 13, 2021, 09:57 UTC
- Message-ID
- <877dl6eccv.fsf@evledraar.gmail.com>
- In-Reply-To
- <d22a5fd37dd793c78b1ac17244601cadd1f7c0c9.1618234575.git.ps@pks.im>
On Mon, Apr 12 2021, Patrick Steinhardt wrote:
> + } else if (skip_prefix(arg, "object:type=", &v0)) {
> + int type = type_from_string_gently(v0, -1, 1);
> + if (type < 0) {
> + strbuf_addstr(errbuf, _("expected 'object:type=<type>'"));Maybe:
strbuf_addstr(errbuf, _("'%s' for 'object:type=<type>' is not a valid object type"), v0);Show 9 quoted lines
> +# Test object:type=<type> filter. > + > +test_expect_success 'setup object-type' ' > + git init object-type && > + echo contents >object-type/blob && > + git -C object-type add blob && > + git -C object-type commit -m commit-message && > + git -C object-type tag tag -m tag-message > +'
Does this really need to not be the shorter:
test_create_repo object-type &&
test_commit -C object-type blobOr if it really needs the annotated tag maybe that + --no-tag + create the tag after, and it can eventually use my https://lore.kernel.org/git/patch-06.16-8d43fdd5865-20210412T110456Z-avarab@gmail.com/
Show 5 quoted lines
> +test_expect_success 'verify object:type=blob prints blob and commit' ' > + ( > + git -C object-type rev-parse HEAD && > + printf "%s blob\n" $(git -C object-type rev-parse HEAD:blob) > + ) >expected &&
Just use > and >> or a single printf with two arguments instead of a subshell?