Skip to content

Commit 8809b24

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

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
@@ -569,7 +569,9 @@ static int apply_sparse_checkout(struct index_state *istate,
569569
ce->ce_flags &= ~CE_SKIP_WORKTREE;
570570
return -1;
571571
}
572-
ce->ce_flags |= CE_WT_REMOVE;
572+
if (!gvfs_config_is_set(GVFS_NO_DELETE_OUTSIDE_SPARSECHECKOUT))
573+
ce->ce_flags |= CE_WT_REMOVE;
574+
573575
ce->ce_flags &= ~CE_UPDATE;
574576
}
575577
if (was_skip_worktree && !ce_skip_worktree(ce)) {

0 commit comments

Comments
 (0)