Skip to content

Commit 4741077

Browse files
derrickstoleegitster
authored andcommitted
sparse-index: include EXTENDED flag when expanding
When creating a full index from a sparse one, we create cache entries for every blob within a given sparse directory entry. These are correctly marked with the CE_SKIP_WORKTREE flag, but the CE_EXTENDED flag is not included. The CE_EXTENDED flag would exist if we loaded a full index from disk with these entries marked with CE_SKIP_WORKTREE, so we can add the flag here to be consistent. This allows us to directly compare the flags present in cache entries when testing the sparse-index feature, but has no significance to its correctness in the user-facing functionality. Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fc6609d commit 4741077

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sparse-index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int add_path_to_index(const struct object_id *oid,
213213
strbuf_addstr(base, path);
214214

215215
ce = make_cache_entry(istate, mode, oid, base->buf, 0, 0);
216-
ce->ce_flags |= CE_SKIP_WORKTREE;
216+
ce->ce_flags |= CE_SKIP_WORKTREE | CE_EXTENDED;
217217
set_index_entry(istate, istate->cache_nr++, ce);
218218

219219
strbuf_setlen(base, len);

0 commit comments

Comments
 (0)