From 1b5f37334a2603c7134da7accba76276d8d31cf6 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Mon, 27 Sep 2021 16:33:43 +0000 Subject: Remove ignored files by default when they are in the way Change several commands to remove ignored files by default when they are in the way. Since some commands (checkout, merge) take a --no-overwrite-ignore option to allow the user to configure this, and it may make sense to add that option to more commands (and in the case of merge, actually plumb that configuration option through to more of the backends than just the fast-forwarding special case), add little comments about where such flags would be used. Incidentally, this fixes a test failure in t7112. Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- reset.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'reset.c') diff --git a/reset.c b/reset.c index 41b3e2d88d..f40a8ecf66 100644 --- a/reset.c +++ b/reset.c @@ -56,8 +56,7 @@ int reset_head(struct repository *r, struct object_id *oid, const char *action, unpack_tree_opts.fn = reset_hard ? oneway_merge : twoway_merge; unpack_tree_opts.update = 1; unpack_tree_opts.merge = 1; - /* FIXME: Default should be to remove ignored files */ - unpack_tree_opts.preserve_ignored = 1; + unpack_tree_opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */ init_checkout_metadata(&unpack_tree_opts.meta, switch_to_branch, oid, NULL); if (!detach_head) unpack_tree_opts.reset = 1; -- cgit v1.2.3