[PATCH v2 09/25] difftool: ensure full index
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 1, 2021, 01:49 UTC
- Message-ID
- <739f3fe9edf276555cfe153e6f165b0af68a72ba.1617241803.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.906.v2.git.1617241802.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>
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> --- builtin/difftool.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/builtin/difftool.c b/builtin/difftool.c index 6e18e623fddf..32c914dde6a0 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
-- gitgitgadget