Re: [PATCH 14/21] Convert ce_path_match() to use struct pathspec
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 17, 2010, 00:02 UTC
- Message-ID
- <7v39pxl10y.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1292425376-14550-15-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 13 quoted lines
> 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?
Show 11 quoted lines
> diff --git a/preload-index.c b/preload-index.c > index e3d0bda..49cb08d 100644 > --- a/preload-index.c > +++ b/preload-index.c > @@ -35,7 +35,9 @@ static void *preload_thread(void *_data) > struct index_state *index = p->index; > struct cache_entry **cep = index->cache + p->offset; > struct cache_def cache; > + struct pathspec pathspec; > > + init_pathspec(&pathspec, p->pathspec);
Likewise; would it make the API cleaner to make read_cache_preload() and read_index_preload() take "const struct pathspec *" instead of the traditional "const char **"?