Re: [PATCH v3 2/2] log: add log.excludeDecoration config option

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

 



"Derrick Stolee via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> diff --git a/log-tree.c b/log-tree.c
> index ab6d29a746b..fd3fd3316a1 100644
> --- a/log-tree.c
> +++ b/log-tree.c
> @@ -103,6 +103,8 @@ static int ref_filter_match(const char *refname,
>  	struct string_list_item *item;
>  	const struct string_list *exclude_patterns = filter->exclude_ref_pattern;
>  	const struct string_list *include_patterns = filter->include_ref_pattern;
> +	const struct string_list *exclude_patterns_config =
> +				filter->exclude_ref_config_pattern;
>  
>  	if (exclude_patterns && exclude_patterns->nr) {
>  		for_each_string_list_item(item, exclude_patterns) {
> @@ -112,17 +114,21 @@ static int ref_filter_match(const char *refname,
>  	}
>  
>  	if (include_patterns && include_patterns->nr) {
> -		int found = 0;
>  		for_each_string_list_item(item, include_patterns) {
>  			if (match_ref_pattern(refname, item)) {
> -				found = 1;
> -				break;
> +				return 1;
>  			}

Micronit.  

Let's mimick the early return in the loop above (for command line
excludes) and below (for configured excludes), each of which is just
a single "return" statement in a block without {braces} around.

Other than that, looks nicely done.

The new tests are really appreciated, too.



[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