{"thread":{"id":"66719","subject":"[Outreachy PATCH] name-hash: use istate->repo instead of the_repository","startedAt":"2026-10-30T18:32:18Z","lastAt":"2026-10-30T18:32:18Z","messageCount":1,"participants":["Okhuomon Ajayi"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"556952","messageId":"20261030183218.32630-1-okhuomonajayi54@gmail.com","threadId":"66719","inReplyTo":null,"subject":"[Outreachy PATCH] name-hash: use istate->repo instead of the_repository","fromName":"Okhuomon Ajayi","fromEmail":"okhuomonajayi54@gmail.com","sentAt":"2026-10-30T18:32:18Z","receivedAt":"2026-10-30T18:32:18Z","isPatch":true,"sender":{"key":"okhuomonajayi54@gmail.com","avatar":null},"body":"hash_index_entry(), lookup_lazy_params(), and remove_name_hash()\nalready receive the index, but read core.ignoreCase through\nthe_repository. The setting belongs to the repository that owns\nthe index. An index for another repository would still follow the\nsetting of the_repository.\n\nRead it from istate->repo instead. Drop USE_THE_REPOSITORY_VARIABLE,\nas nothing else in the file uses the_repository.\n\nSigned-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>\n---\nI checked whether istate->repo can be NULL here: it is set whenever\nan index is initialized, and repo_ignore_case() returns 0 for a NULL\nrepository anyway.\n\n name-hash.c | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/name-hash.c b/name-hash.c\nindex 83757db874..98e170851e 100644\n--- a/name-hash.c\n+++ b/name-hash.c\n@@ -6,7 +6,6 @@\n  * Copyright (C) 2008 Linus Torvalds\n  */\n \n-#define USE_THE_REPOSITORY_VARIABLE\n #define DISABLE_SIGN_COMPARE_WARNINGS\n \n #include \"git-compat-util.h\"\n@@ -126,7 +125,7 @@ static void hash_index_entry(struct index_state *istate, struct cache_entry *ce)\n \t\thashmap_add(&istate->name_hash, &ce->ent);\n \t}\n \n-\tif (repo_ignore_case(the_repository))\n+\tif (repo_ignore_case(istate->repo))\n \t\tadd_dir_entry(istate, ce);\n }\n \n@@ -207,7 +206,7 @@ static int lookup_lazy_params(struct index_state *istate)\n \t * code to build the \"istate->name_hash\".  We don't\n \t * need the complexity here.\n \t */\n-\tif (!repo_ignore_case(the_repository))\n+\tif (!repo_ignore_case(istate->repo))\n \t\treturn 0;\n \n \tnr_cpus = online_cpus();\n@@ -651,7 +650,7 @@ void remove_name_hash(struct index_state *istate, struct cache_entry *ce)\n \tce->ce_flags &= ~CE_HASHED;\n \thashmap_remove(&istate->name_hash, &ce->ent, ce);\n \n-\tif (repo_ignore_case(the_repository))\n+\tif (repo_ignore_case(istate->repo))\n \t\tremove_dir_entry(istate, ce);\n }\n \n\nbase-commit: b9e5cff1803ab24582201ef059516eb16014b9d9\n-- \n2.56.0\n\n\n"}]}