Skip to content

Commit

Permalink
Do not remove files outside the sparse-checkout
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Willford <kewillf@microsoft.com>
  • Loading branch information
Kevin Willford authored and dscho committed Aug 16, 2023
1 parent 3a67219 commit db575fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion unpack-trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,9 @@ static int apply_sparse_checkout(struct index_state *istate,
ce->ce_flags &= ~CE_SKIP_WORKTREE;
return -1;
}
ce->ce_flags |= CE_WT_REMOVE;
if (!gvfs_config_is_set(GVFS_NO_DELETE_OUTSIDE_SPARSECHECKOUT))
ce->ce_flags |= CE_WT_REMOVE;

ce->ce_flags &= ~CE_UPDATE;
}
if (was_skip_worktree && !ce_skip_worktree(ce)) {
Expand Down

0 comments on commit db575fc

Please sign in to comment.