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

[PATCH 10/10] dir.c: drop unused "untracked" from treat_path_fast()

From
Jeff King <peff@peff.net>
Date
Sep 30, 2020, 12:35 UTC
Message-ID
<20200930123500.GJ1901279@coredump.intra.peff.net>
In-Reply-To
<20200930122732.GA1901036@coredump.intra.peff.net>

We don't use the untracked_cache_dir parameter that is passed in, but instead look at the untracked_cache_dir inside the cached_dir struct we are passed. It's been this way since the introduction of treat_path_fast() in 91a2288b5f (untracked cache: record/validate dir mtime and reuse cached output, 2015-03-08).

Signed-off-by: Jeff King <peff@peff.net>
---
This is the one I'm least sure of (not that it makes anything worse, but
that it might be hiding a bug; I'm pretty sure I just don't understand
how the untracked-cache code works, though).
 dir.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dir.c b/dir.c
index 3018a657b0..78387110e6 100644
--- a/dir.c
+++ b/dir.c
@@ -2105,7 +2105,6 @@ static int resolve_dtype(int dtype, struct index_state *istate,
 }
 
 static enum path_treatment treat_path_fast(struct dir_struct *dir,
-					   struct untracked_cache_dir *untracked,
 					   struct cached_dir *cdir,
 					   struct index_state *istate,
 					   struct strbuf *path,
@@ -2153,7 +2152,7 @@ static enum path_treatment treat_path(struct dir_struct *dir,
 	int has_path_in_index, dtype, excluded;
 
 	if (!cdir->d_name)
-		return treat_path_fast(dir, untracked, cdir, istate, path,
+		return treat_path_fast(dir, cdir, istate, path,
 				       baselen, pathspec);
 	if (is_dot_or_dotdot(cdir->d_name) || !fspathcmp(cdir->d_name, ".git"))
 		return path_none;
-- 
2.28.0.1173.gad90222cf0
Previous: Jeff King
Message 11 of 11 in “dropping more unused parameters”
  1. 0/10 dropping more unused parametersJeff King, Sep 30, 2020
  2. 01/10 convert: drop unused crlf_action from check_global_conv_flags_eol()Jeff King, Sep 30, 2020
  3. 02/10 drop unused argc parametersJeff King, Sep 30, 2020
  4. 03/10 env--helper: write to opt->value in parseopt helperJeff King, Sep 30, 2020
  5. 04/10 assert PARSE_OPT_NONEG in parse-options callbacksJeff King, Sep 30, 2020
  6. 05/10 push: drop unused repo argument to do_push()Jeff King, Sep 30, 2020
  7. 06/10 sequencer: drop repository argument from run_git_commit()Jeff King, Sep 30, 2020
  8. 07/10 sparse-checkout: fill in some options boilerplateJeff King, Sep 30, 2020
  9. 08/10 test-advise: check argument count with argc instead of argvJeff King, Sep 30, 2020
  10. 09/10 sequencer: handle ignore_footer when parsing trailersJeff King, Sep 30, 2020
  11. 10/10 dir.c: drop unused "untracked" from treat_path_fast()Jeff King, Sep 30, 2020

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.