summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Derrick Stolee <dstolee@microsoft.com>2021-04-01 01:49:46 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-04-14 13:47:09 -0700
commit48b3c7da6c58752b0fbc73e891fd5b24c95281b1 (patch)
tree3fd4f523121e4d15d45bd7f663f3c616d527f0b7
parentcommit: ensure full index (diff)
downloadtgif-48b3c7da6c58752b0fbc73e891fd5b24c95281b1.tar.xz
difftool: ensure full index
Before iterating over all cache entries, ensure that a sparse index has been expanded to a full one to avoid unexpected behavior. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/difftool.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 6e18e623fd..32c914dde6 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -584,6 +584,9 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
setenv("GIT_DIFFTOOL_DIRDIFF", "true", 1);
rc = run_command_v_opt(helper_argv, flags);
+ /* TODO: audit for interaction with sparse-index. */
+ ensure_full_index(&wtindex);
+
/*
* If the diff includes working copy files and those
* files were modified during the diff, then the changes