Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diff: enable and test the sparse index
Enable the sparse index within the 'git diff' command. Its implementation already safely integrates with the sparse index because it shares code with the 'git status' and 'git checkout' commands that were already integrated. The most interesting thing to do is to add tests that verify that 'git diff' behaves correctly when the sparse index is enabled. These cases are... 1. The index is not expanded for `diff` and `diff --staged` (which both involve reading from the index). 2. `diff` and `diff --staged` behave the same in full checkout, sparse checkout, and sparse index repositories in the following partially-staged scenarios (i.e. the index, HEAD, and working directory differ at a given path): 1. Path is within sparse-checkout cone. 2. Path is outside sparse-checkout cone. 3. A merge conflict exists for paths outside sparse-checkout cone. Signed-off-by: Lessley Dennington <lessleydennington@gmail.com>
- Loading branch information