git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] clean: avoid looking for nested repository when appropriate
@ 2022-02-15 22:16 Patrick Marlier
  2022-02-15 22:16 ` [PATCH 2/2] clean: avoid to differentiate untracked and ignored " Patrick Marlier
  2022-02-16  4:09 ` [PATCH 1/2] clean: avoid looking for nested repository " Elijah Newren
  0 siblings, 2 replies; 4+ messages in thread
From: Patrick Marlier @ 2022-02-15 22:16 UTC (permalink / raw)
  To: git, newren; +Cc: Patrick Marlier

avoiding the unnecessary checks for is_nonbare_repository_dir() via setting DIR_NO_GITLINKS
---
 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] 4+ messages in thread

end of thread, other threads:[~2022-02-16  4:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-15 22:16 [PATCH 1/2] clean: avoid looking for nested repository when appropriate Patrick Marlier
2022-02-15 22:16 ` [PATCH 2/2] clean: avoid to differentiate untracked and ignored " Patrick Marlier
2022-02-16  4:16   ` Elijah Newren
2022-02-16  4:09 ` [PATCH 1/2] clean: avoid looking for nested repository " Elijah Newren

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 NNTP newsgroup(s).