Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions builtin/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
}

prefix = setup_git_directory_gently(&nongit);

prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;

if (!no_index) {
/*
Expand Down
5 changes: 5 additions & 0 deletions t/t1092-sparse-checkout-compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,11 @@ test_expect_success 'sparse-index is not expanded' '
echo >>sparse-index/untracked.txt &&
ensure_not_expanded add . &&

echo "a test change" >> sparse-index/README.md &&
ensure_not_expanded diff &&
git -C sparse-index add README.md &&
ensure_not_expanded diff --staged &&

ensure_not_expanded checkout -f update-deep &&
(
sane_unset GIT_TEST_MERGE_ALGORITHM &&
Expand Down