lockfile: allow reopening a closed but still locked file
[gitweb.git] / unpack-trees.c
index a941f7c33e709a4af148f4d29373b4761a2843cd..4a9cdf2105f03f4f615d88155d28984f3fcf50ae 100644 (file)
@@ -257,8 +257,10 @@ static int apply_sparse_checkout(struct index_state *istate,
                ce->ce_flags |= CE_SKIP_WORKTREE;
        else
                ce->ce_flags &= ~CE_SKIP_WORKTREE;
-       if (was_skip_worktree != ce_skip_worktree(ce))
+       if (was_skip_worktree != ce_skip_worktree(ce)) {
+               ce->ce_flags |= CE_UPDATE_IN_BASE;
                istate->cache_changed |= CE_ENTRY_CHANGED;
+       }
 
        /*
         * if (!was_skip_worktree && !ce_skip_worktree()) {