Re: [PATCH 4/6] Convert struct diff_options to use struct pathspec

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

 



Nguyán ThÃi Ngác Duy  <pclouds@xxxxxxxxx> writes:

> diff --git a/revision.c b/revision.c
> index b1c1890..b2a5867 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -553,11 +553,7 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
>  
>  	left_first = left_count < right_count;
>  	init_patch_ids(&ids);
> -	if (revs->diffopt.nr_paths) {
> -		ids.diffopts.nr_paths = revs->diffopt.nr_paths;
> -		ids.diffopts.paths = revs->diffopt.paths;
> -		ids.diffopts.pathlens = revs->diffopt.pathlens;
> -	}
> +	ids.diffopts.pathspec = revs->diffopt.pathspec;

Just a mental note; we need to be careful not to destroy this structure
(i.e. freeing ids.diffopts.pathspec.items) when we are done with ids.

Nice code reduction ;-)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]