Skip to content

Commit aee93c9

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

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
@@ -573,7 +573,9 @@ static int apply_sparse_checkout(struct index_state *istate,
573573
ce->ce_flags &= ~CE_SKIP_WORKTREE;
574574
return -1;
575575
}
576-
ce->ce_flags |= CE_WT_REMOVE;
576+
if (!gvfs_config_is_set(GVFS_NO_DELETE_OUTSIDE_SPARSECHECKOUT))
577+
ce->ce_flags |= CE_WT_REMOVE;
578+
577579
ce->ce_flags &= ~CE_UPDATE;
578580
}
579581
if (was_skip_worktree && !ce_skip_worktree(ce)) {

0 commit comments

Comments
 (0)