git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] clean: avoid looking for nested repository when appropriate

From
PMPatrick Marlier <patrick.marlier@gmail.com>
Date
Feb 15, 2022, 22:16 UTC
Message-ID
<20220215221615.20683-1-patrick.marlier@gmail.com>
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
Next: Patrick Marlier
Message 1 of 4 in “clean: avoid looking for nested repository when appropriate”
  1. 1/2 clean: avoid looking for nested repository when appropriatePatrick Marlier, Feb 15, 2022
  2. 2/2 clean: avoid to differentiate untracked and ignored when appropriatePatrick Marlier, Feb 15, 2022
  3. Elijah NewrenFeb 16, 2022
  4. Elijah NewrenFeb 16, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.