From: Derrick Stolee <redacted>
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 <redacted>
---
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