Re: [PATCH 14/21] Convert ce_path_match() 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/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?

> 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 **"?
--
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]