Re: [PATCH 26/27] pathspec: stop calling ensure_full_index
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 1, 2021, 23:24 UTC
- Message-ID
- <CABPp-BHv+kAV5BfrhdQ+Vo-q_eVs7a3MvLYg0wYhZQoyvCoqaw@mail.gmail.com>
- In-Reply-To
- <5f53b08225771adc0be12c39e7be169d8620f146.1611596534.git.gitgitgadget@gmail.com>
On Mon, Jan 25, 2021 at 9:42 AM Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 11 quoted lines
> > From: Derrick Stolee <dstolee@microsoft.com> > > The add_pathspec_matches_against_index() focuses on matching a pathspec > to file entries in the index. It is possible that this already works > correctly for its only use: checking if untracked files exist in the > index. > > It is likely that this causes a behavior issue when adding a directory > that exists at HEAD but is outside the sparse cone. I'm marking this as > a place to pursue with future tests.
Sounds like you're unsure if this patch is good. Should it be marked RFC or something?
Show 20 quoted lines
> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
> ---
> pathspec.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/pathspec.c b/pathspec.c
> index 9b105855483..61dc771aa02 100644
> --- a/pathspec.c
> +++ b/pathspec.c
> @@ -36,7 +36,6 @@ void add_pathspec_matches_against_index(const struct pathspec *pathspec,
> num_unmatched++;
> if (!num_unmatched)
> return;
> - ensure_full_index(istate);
> for (i = 0; i < istate->cache_nr; i++) {
> const struct cache_entry *ce = istate->cache[i];
> ce_path_match(istate, ce, pathspec, seen);
> --
> gitgitgadget
>