From: Derrick Stolee via GitGitGadget Date: Mon, 25 Jan 2021 17:42:10 GMT Subject: [PATCH 24/27] dir: use expand_to_path in add_patterns() Message-ID: <926a2e12cf7534339e1f9bedff50d97bf251ffa2.1611596534.git.gitgitgadget@gmail.com> In-Reply-To: From: Derrick Stolee The add_patterns() method has a way to extract a pattern file from the index. If this pattern file is sparse and within a sparse directory entry, then we need to expand the index before looking for that entry as a file path. For now, convert ensure_full_index() into expand_to_path() to only expand this way when absolutely necessary. Signed-off-by: Derrick Stolee --- dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dir.c b/dir.c index 21998c7c4b7..7df8d3b1da0 100644 --- a/dir.c +++ b/dir.c @@ -1093,7 +1093,7 @@ static int add_patterns(const char *fname, const char *base, int baselen, int pos; if (istate) - ensure_full_index(istate); + expand_to_path(istate, fname, strlen(fname), 0); if (oid_stat->valid && !match_stat_data_racy(istate, &oid_stat->stat, &st)) -- gitgitgadget