Skip to content

Commit f5836f8

Browse files
Kevin Willforddscho
authored andcommitted
Do not remove files outside the sparse-checkout
Signed-off-by: Kevin Willford <kewillf@microsoft.com>
1 parent 8836cf9 commit f5836f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

unpack-trees.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,9 @@ static int apply_sparse_checkout(struct index_state *istate,
572572
ce->ce_flags &= ~CE_SKIP_WORKTREE;
573573
return -1;
574574
}
575-
ce->ce_flags |= CE_WT_REMOVE;
575+
if (!gvfs_config_is_set(GVFS_NO_DELETE_OUTSIDE_SPARSECHECKOUT))
576+
ce->ce_flags |= CE_WT_REMOVE;
577+
576578
ce->ce_flags &= ~CE_UPDATE;
577579
}
578580
if (was_skip_worktree && !ce_skip_worktree(ce)) {

0 commit comments

Comments
 (0)