Re: [PATCH v4 5/8] list-objects: implement object type filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);

> +# 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 blob

Or 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@xxxxxxxxx/

> +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?



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux