Re: [PATCH 14/21] Convert ce_path_match() to use struct pathspec
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 17, 2010, 09:59 UTC
- Message-ID
- <AANLkTikKCU==mS5_TdqHstETj=CQ_deHMCJ4xW0r+Sck@mail.gmail.com>
- In-Reply-To
- <7v39pxl10y.fsf@alter.siamese.dyndns.org>
2010/12/17 Junio C Hamano <gitster@pobox.com>:
Show 19 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: > >> diff --git a/diff-lib.c b/diff-lib.c >> index 3b809f2..63db7f4 100644 >> --- a/diff-lib.c >> +++ b/diff-lib.c >> @@ -89,9 +89,11 @@ int run_diff_files(struct rev_info *revs, unsigned int option) >> int silent_on_removed = option & DIFF_SILENT_ON_REMOVED; >> unsigned ce_option = ((option & DIFF_RACY_IS_MODIFIED) >> ? CE_MATCH_RACY_IS_DIRTY : 0); >> + struct pathspec pathspec; >> >> diff_set_mnemonic_prefix(&revs->diffopt, "i/", "w/"); >> >> + init_pathspec(&pathspec, revs->prune_data); > > I wonder if it makes more sense to change the type of revs->prune_data > from an array of pointers to strings to a pointer to struct pathspec. > Is there a downside?
Converting a pointer to another pointer means mis typecasting can happen and the compiler won't help catching them. I thinking of changing prune_data to simply struct pathspec. Looks like it breaks thing.. hm...
-- Duy