summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unpack-trees.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index dde50047a8..e8e794880a 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -500,8 +500,11 @@ static int apply_sparse_checkout(struct index_state *istate,
* also stat info may have lost after merged_entry() so calling
* verify_uptodate() again may fail
*/
- if (!(ce->ce_flags & CE_UPDATE) && verify_uptodate_sparse(ce, o))
+ if (!(ce->ce_flags & CE_UPDATE) &&
+ verify_uptodate_sparse(ce, o)) {
+ ce->ce_flags &= ~CE_SKIP_WORKTREE;
return -1;
+ }
ce->ce_flags |= CE_WT_REMOVE;
ce->ce_flags &= ~CE_UPDATE;
}