On 9/8/2022 1:56 PM, Junio C Hamano wrote: >> Shaoxuan's comment is attempting to list the reasons why submodules >> do not currently work with sparse-index, > > "do not currently work" in a sense that it produces wrong result, or > it just expands in-core index unnecessarily before applying pathspec > to produce the right result in an inefficient way? It's the latter situation. It expands the index inefficiently though, the results are correct. The other problem is that, there is no sparse directories in an expanded index, thus we cannot test how does the grep_tree() approach (introduced in the third patch) work within submodules.