{"thread":{"id":"66662","subject":"[Outreachy PATCH] notes-cache: read the cache ref from the given repository","startedAt":"2026-10-26T10:26:03Z","lastAt":"2026-10-26T16:57:27Z","messageCount":2,"participants":["Okhuomon Ajayi","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"556303","messageId":"20261026102603.32377-1-okhuomonajayi54@gmail.com","threadId":"66662","inReplyTo":null,"subject":"[Outreachy PATCH] notes-cache: read the cache ref from the given repository","fromName":"Okhuomon Ajayi","fromEmail":"okhuomonajayi54@gmail.com","sentAt":"2026-10-26T10:26:03Z","receivedAt":"2026-10-26T10:26:03Z","isPatch":true,"sender":{"key":"okhuomonajayi54@gmail.com","avatar":null},"body":"notes_cache_match_validity() already receives the repository as\nr and uses it for the commit lookup. The ref read still used\nthe_repository.\n\nPass r to get_main_ref_store() so the validity check reads the\nref from the same repository.\n\nSigned-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>\n---\n notes-cache.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/notes-cache.c b/notes-cache.c\nindex 74cef802bd..ccc071ebd0 100644\n--- a/notes-cache.c\n+++ b/notes-cache.c\n@@ -20,7 +20,7 @@ static int notes_cache_match_validity(struct repository *r,\n \tstruct strbuf msg = STRBUF_INIT;\n \tint ret;\n \n-\tif (refs_read_ref(get_main_ref_store(the_repository), ref, &oid) < 0)\n+\tif (refs_read_ref(get_main_ref_store(r), ref, &oid) < 0)\n \t\treturn 0;\n \n \tcommit = lookup_commit_reference_gently(r, &oid, 1);\n\nbase-commit: 7e34d8174dcda3435d1404c9a30bef46afe6c13e\n-- \n2.56.0\n\n\n"},{"id":"556372","messageId":"xmqqo6cgs8lk.fsf@gitster.g","threadId":"66662","inReplyTo":"20261026102603.32377-1-okhuomonajayi54@gmail.com","subject":"Re: [Outreachy PATCH] notes-cache: read the cache ref from the given repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-26T16:57:27Z","receivedAt":"2026-10-26T16:57:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Okhuomon Ajayi <okhuomonajayi54@gmail.com> writes:\n\n> notes_cache_match_validity() already receives the repository as\n> r and uses it for the commit lookup. The ref read still used\n> the_repository.\n>\n> Pass r to get_main_ref_store() so the validity check reads the\n> ref from the same repository.\n>\n> Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com>\n> ---\n>  notes-cache.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/notes-cache.c b/notes-cache.c\n> index 74cef802bd..ccc071ebd0 100644\n> --- a/notes-cache.c\n> +++ b/notes-cache.c\n> @@ -20,7 +20,7 @@ static int notes_cache_match_validity(struct repository *r,\n>  \tstruct strbuf msg = STRBUF_INIT;\n>  \tint ret;\n>  \n> -\tif (refs_read_ref(get_main_ref_store(the_repository), ref, &oid) < 0)\n> +\tif (refs_read_ref(get_main_ref_store(r), ref, &oid) < 0)\n>  \t\treturn 0;\n>  \n>  \tcommit = lookup_commit_reference_gently(r, &oid, 1);\n\nThis is straightforward.  The function does not seem to call\nany function that implicitly relies on 'the_repository' either,\nmaking this a trivial improvement.\n\nThanks.\n\n"}]}