]> git.ipfire.org Git - thirdparty/git.git/commitdiff
difftool: ensure full index
authorDerrick Stolee <dstolee@microsoft.com>
Thu, 1 Apr 2021 01:49:46 +0000 (01:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Apr 2021 20:47:09 +0000 (13:47 -0700)
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>
builtin/difftool.c

index 6e18e623fddfbfb33a3de9f4df8cabbbc048ed51..32c914dde6a0eaa0f519f833a06bfc60ba694f41 100644 (file)
@@ -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