[PATCH 09/27] difftool: ensure full index

From
Derrick Stolee via GitGitGadget <hidden>
Date
2021-03-16 21:18:28
Reply to
Derrick Stolee via GitGitGadget, 2021-03-16
From: Derrick Stolee <redacted>

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 <redacted>
---
 builtin/difftool.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 6e18e623fddf..1d62f77efa61 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -584,6 +584,8 @@ 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);
 
+	ensure_full_index(&wtindex);
+
 	/*
 	 * If the diff includes working copy files and those
 	 * files were modified during the diff, then the changes
-- 
gitgitgadget
Thread (105 messages) 105 messages, 5 authors, 2021-04-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help