From: Junio C Hamano Date: Mon, 27 Sep 2010 22:19:56 GMT Subject: Re: [PATCH 4/6] Convert struct diff_options to use struct pathspec Message-ID: <7vzkv2vng3.fsf@alter.siamese.dyndns.org> In-Reply-To: <1284938514-16663-5-git-send-email-pclouds@gmail.com> Nguyễn Thái Ngọc Duy 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 ;-)