Re: [PATCH v7 7/7] list-objects-filter: implement filter tree:0

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

 



Matthew DeVore <matvore@xxxxxxxxxx> writes:

> @@ -50,6 +50,10 @@ static int gently_parse_list_objects_filter(
>  			return 0;
>  		}
>  
> +	} else if (!strcmp(arg, "tree:0")) {
> +		filter_options->choice = LOFC_TREE_NONE;
> +		return 0;
> +

This is not wrong per-se, but I would have expected to see something
like:

	... else if (skip_prefix(arg, "tree:", &param)) {
		unsigned long depth;
		if (!git_parse_ulong(param, &depth) || depth != 0) {
			err = "only 'tree:0' is supported";
			return -1;
		}
		filter_options->choice = LOFC_TREE_NONE;
		return 0;

so that "tree:1" is rejected not with "invalid filter-spec" but a
bit more descriptive "only tree:0 is".  Accepting "tree:00" or
"tree:0k" is merely an added bogus^wbonus.




[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