Re: [PATCH v2 14/16] pathspec: create strip submodule slash helpers

2016-12-09 Thread Duy Nguyen
On Fri, Dec 9, 2016 at 7:28 AM, Junio C Hamano wrote: > Brandon Williams writes: > >> +static void strip_submodule_slash_cheap(struct pathspec_item *item) >> +{ >> + int i; >> + >> + if ((item->len >= 1 && item->match[item->len - 1] == '/') && >> +

Re: [PATCH v2 14/16] pathspec: create strip submodule slash helpers

2016-12-08 Thread Junio C Hamano
Brandon Williams writes: > +static void strip_submodule_slash_cheap(struct pathspec_item *item) > +{ > + int i; > + > + if ((item->len >= 1 && item->match[item->len - 1] == '/') && > + (i = cache_name_pos(item->match, item->len - 1)) >= 0 && > +

[PATCH v2 14/16] pathspec: create strip submodule slash helpers

2016-12-08 Thread Brandon Williams
Factor out the logic responsible for stripping the trailing slash on pathspecs referencing submodules into its own function. Signed-off-by: Brandon Williams --- pathspec.c | 68 ++ 1 file changed, 42 insertions(+),