git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v2 1/2] clean: avoid looking for nested repositories when unnecessary
@ 2022-02-21  9:00 Patrick Marlier
  2022-02-21  9:00 ` [PATCH v2 2/2] clean: avoid traversing into untracked dirs " Patrick Marlier
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Marlier @ 2022-02-21  9:00 UTC (permalink / raw)
  To: git, newren; +Cc: Patrick Marlier

With `git clean --ff` we will be deleting nested untracked repositories,
so there is no need to differentiate them from other untracked files.
Use the DIR_NO_GITLINKS flag in dir.flags to signify this and avoid the
is_nonbare_repository_dir() checks.
---
 builtin/clean.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/builtin/clean.c b/builtin/clean.c
index 3ff02bbbff..18b37e3fd9 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -955,9 +955,10 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 				  " refusing to clean"));
 	}
 
-	if (force > 1)
+	if (force > 1) {
 		rm_flags = 0;
-	else
+		dir.flags |= DIR_NO_GITLINKS;
+	} else
 		dir.flags |= DIR_SKIP_NESTED_GIT;
 
 	dir.flags |= DIR_SHOW_OTHER_DIRECTORIES;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-22  1:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21  9:00 [PATCH v2 1/2] clean: avoid looking for nested repositories when unnecessary Patrick Marlier
2022-02-21  9:00 ` [PATCH v2 2/2] clean: avoid traversing into untracked dirs " Patrick Marlier
2022-02-22  1:48   ` Elijah Newren

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).