From 1e9e10e04891a13e5ccd52b36cfadc55dfaa5066 Mon Sep 17 00:00:00 2001 From: Victoria Dye Date: Tue, 11 Jan 2022 18:05:00 +0000 Subject: clean: integrate with sparse index Remove full index requirement for `git clean` and test to ensure the index is not expanded in `git clean`. Add to existing test for `git clean` to verify cleanup of untracked files in sparse directories is consistent between sparse index and non-sparse index checkouts. Signed-off-by: Victoria Dye Reviewed-by: Elijah Newren Signed-off-by: Junio C Hamano --- builtin/clean.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'builtin/clean.c') diff --git a/builtin/clean.c b/builtin/clean.c index 98a2860409..5628fc7103 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -983,6 +983,9 @@ int cmd_clean(int argc, const char **argv, const char *prefix) dir.flags |= DIR_KEEP_UNTRACKED_CONTENTS; } + prepare_repo_settings(the_repository); + the_repository->settings.command_requires_full_index = 0; + if (read_cache() < 0) die(_("index file corrupt")); -- cgit v1.3-6-g1900