Re: [PATCH] builtin-commit: fix partial-commit support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> diff --git a/builtin-commit.c b/builtin-commit.c
> index 3e7d281..e487bc0 100644
> --- a/builtin-commit.c
> +++ b/builtin-commit.c

There was another...

> +static int list_paths(struct path_list *list, const char *with_tree,
> +		      const char *prefix, const char **pattern)
> +{
> +	struct dir_struct dir;
> +	int i;
> +	char *m;
> +
> +	for (i = 0; pattern[i]; i++)
> +		;
> +	m = xcalloc(1, i);
> +
> +	memset(&dir, 0, sizeof(dir));
> +	if (with_tree)
> +		overlay_tree_on_cache(with_tree, prefix);
> +
> +	for (i = 0; i < active_nr; i++) {
> +		struct cache_entry *ce = active_cache[i];
> +		if (ce->ce_flags & htons(CE_UPDATE))
> +			continue;
> +		if (!pathspec_match(pattern, m, ce->name, 0))
> +			continue;
> +		if (excluded(&dir, ce->name))
> +			continue;
> +		path_list_insert(ce->name, list);
> +	}

This "excluded", and the whole "struct dir" business is
unneeded, as we are walking on the index and finding the set of
paths the user cares about.

-
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]

  Powered by Linux