Skip to content

Commit a5c446f

Browse files
pcloudsgitster
authored andcommitted
unpack-trees: be specific what part of the index has changed
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 6c306a3 commit a5c446f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

unpack-trees.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,18 @@ static int verify_absent_sparse(const struct cache_entry *ce,
246246
enum unpack_trees_error_types,
247247
struct unpack_trees_options *o);
248248

249-
static int apply_sparse_checkout(struct cache_entry *ce, struct unpack_trees_options *o)
249+
static int apply_sparse_checkout(struct index_state *istate,
250+
struct cache_entry *ce,
251+
struct unpack_trees_options *o)
250252
{
251253
int was_skip_worktree = ce_skip_worktree(ce);
252254

253255
if (ce->ce_flags & CE_NEW_SKIP_WORKTREE)
254256
ce->ce_flags |= CE_SKIP_WORKTREE;
255257
else
256258
ce->ce_flags &= ~CE_SKIP_WORKTREE;
259+
if (was_skip_worktree != ce_skip_worktree(ce))
260+
istate->cache_changed |= CE_ENTRY_CHANGED;
257261

258262
/*
259263
* if (!was_skip_worktree && !ce_skip_worktree()) {
@@ -1131,7 +1135,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
11311135
ret = -1;
11321136
}
11331137

1134-
if (apply_sparse_checkout(ce, o)) {
1138+
if (apply_sparse_checkout(&o->result, ce, o)) {
11351139
if (!o->show_all_errors)
11361140
goto return_failed;
11371141
ret = -1;

0 commit comments

Comments
 (0)