aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-12-21 15:03:17 -0800
committerJunio C Hamano <gitster@pobox.com>2021-12-21 15:03:17 -0800
commit8d2c37320bd01bbce4b88365c160bc4a542bee48 (patch)
treed805155422fb863b694eaaeb71967d9667f9e81d /builtin/diff.c
parentMerge branch 'en/name-rev-shorter-output' (diff)
parentblame: enable and test the sparse index (diff)
downloadgit-8d2c37320bd01bbce4b88365c160bc4a542bee48.tar.gz
git-8d2c37320bd01bbce4b88365c160bc4a542bee48.zip
Merge branch 'ld/sparse-diff-blame'
Teach diff and blame to work well with sparse index. * ld/sparse-diff-blame: blame: enable and test the sparse index diff: enable and test the sparse index diff: replace --staged with --cached in t1092 tests repo-settings: prepare_repo_settings only in git repos test-read-cache: set up repo after git directory commit-graph: return if there is no git directory git: ensure correct git directory setup with -h
Diffstat (limited to 'builtin/diff.c')
-rw-r--r--builtin/diff.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index dd8ce688ba..fa4683377e 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -437,6 +437,11 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
prefix = setup_git_directory_gently(&nongit);
+ if (!nongit) {
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
+ }
+
if (!no_index) {
/*
* Treat git diff with at least one path outside of the