Hi Victoria, > If a user manually modifies a SKIP_WORKTREE file, SKIP_WORKTREE will be > removed from the file and the index expanded automatically [1]. If that > mechanism is working properly, there would be no need to manually check the > pathspec and expand the index. > > Have you tried removing the 'pathspec_needs_expanded_index()' and running > the tests? If so, is 'diff-files' producing incorrect results? > > [1] https://lore.kernel.org/git/11d46a399d26c913787b704d2b7169cafc28d639.1642175983.git.gitgitgadget@xxxxxxxxx/ As per your suggestion, I tried removing pathspec_needs_expanded_index() from the code, and 'diff-files pathspec expands index when necessary' test failed. So, I'm thinking about keeping it to ensure everything works properly. I'd like to know your thoughts on this. Should we keep it or explore other options? Thanks, Shuqi