Skip to content

Commit fc401f3

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

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
@@ -557,7 +557,9 @@ static int apply_sparse_checkout(struct index_state *istate,
557557
ce->ce_flags &= ~CE_SKIP_WORKTREE;
558558
return -1;
559559
}
560-
ce->ce_flags |= CE_WT_REMOVE;
560+
if (!gvfs_config_is_set(GVFS_NO_DELETE_OUTSIDE_SPARSECHECKOUT))
561+
ce->ce_flags |= CE_WT_REMOVE;
562+
561563
ce->ce_flags &= ~CE_UPDATE;
562564
}
563565
if (was_skip_worktree && !ce_skip_worktree(ce)) {

0 commit comments

Comments
 (0)