Thread (105 messages) 105 messages, 5 authors, 2021-04-13

Re: [PATCH 17/27] diff-lib: ensure full index

flat view

From: Elijah Newren <hidden>
Date: 2021-03-18 05:25:57

On Tue, Mar 16, 2021 at 2:17 PM Derrick Stolee via GitGitGadget
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Derrick Stolee <redacted>

Before iterating over all cache entries, ensure that a sparse index is
expanded to a full index to avoid unexpected behavior.

Signed-off-by: Derrick Stolee <redacted>
---
 diff-lib.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/diff-lib.c b/diff-lib.c
index b73cc1859a49..41d6fcec1a81 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -102,6 +102,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)

        if (diff_unmerged_stage < 0)
                diff_unmerged_stage = 2;
+
        entries = istate->cache_nr;
        for (i = 0; i < entries; i++) {
                unsigned int oldmode, newmode;
I don't think adding a blank newline will ensure the index is expanded.  ;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help