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

[Outreachy PATCH] name-hash: use istate->repo instead of the_repository

From
OAOkhuomon Ajayi <okhuomonajayi54@gmail.com>
Date
Oct 30, 2026, 18:32 UTC
Message-ID
<20261030183218.32630-1-okhuomonajayi54@gmail.com>

hash_index_entry(), lookup_lazy_params(), and remove_name_hash() already receive the index, but read core.ignoreCase through the_repository. The setting belongs to the repository that owns the index. An index for another repository would still follow the setting of the_repository.

Read it from istate->repo instead. Drop USE_THE_REPOSITORY_VARIABLE, as nothing else in the file uses the_repository.

Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>
---
I checked whether istate->repo can be NULL here: it is set whenever
an index is initialized, and repo_ignore_case() returns 0 for a NULL
repository anyway.
 name-hash.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/name-hash.c b/name-hash.c
index 83757db874..98e170851e 100644
--- a/name-hash.c
+++ b/name-hash.c
@@ -6,7 +6,6 @@
  * Copyright (C) 2008 Linus Torvalds
  */
 
-#define USE_THE_REPOSITORY_VARIABLE
 #define DISABLE_SIGN_COMPARE_WARNINGS
 
 #include "git-compat-util.h"
@@ -126,7 +125,7 @@ static void hash_index_entry(struct index_state *istate, struct cache_entry *ce)
 		hashmap_add(&istate->name_hash, &ce->ent);
 	}
 
-	if (repo_ignore_case(the_repository))
+	if (repo_ignore_case(istate->repo))
 		add_dir_entry(istate, ce);
 }
 
@@ -207,7 +206,7 @@ static int lookup_lazy_params(struct index_state *istate)
 	 * code to build the "istate->name_hash".  We don't
 	 * need the complexity here.
 	 */
-	if (!repo_ignore_case(the_repository))
+	if (!repo_ignore_case(istate->repo))
 		return 0;
 
 	nr_cpus = online_cpus();
@@ -651,7 +650,7 @@ void remove_name_hash(struct index_state *istate, struct cache_entry *ce)
 	ce->ce_flags &= ~CE_HASHED;
 	hashmap_remove(&istate->name_hash, &ce->ent, ce);
 
-	if (repo_ignore_case(the_repository))
+	if (repo_ignore_case(istate->repo))
 		remove_dir_entry(istate, ce);
 }
 

base-commit: b9e5cff1803ab24582201ef059516eb16014b9d9
-- 
2.56.0
Message 1 of 1 in “name-hash: use istate->repo instead of the_repository”
  1. name-hash: use istate->repo instead of the_repositoryOkhuomon Ajayi, Oct 30, 2026

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.