From: Okhuomon Ajayi Date: Tue, 03 Nov 2026 08:49:29 GMT Subject: [Outreachy PATCH v2 1/2] notes-utils: use the passed repository for notes refs Message-ID: <20261103084930.15532-2-okhuomonajayi54@gmail.com> In-Reply-To: <20261103084930.15532-1-okhuomonajayi54@gmail.com> create_notes_commit() and commit_notes() receive a repository, but read and update the notes ref in the_repository. Use the repository they are given. Keep USE_THE_REPOSITORY_VARIABLE because init_copy_notes_for_rewrite() still uses the_repository. Signed-off-by: Okhuomon Ajayi --- notes-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notes-utils.c b/notes-utils.c index 5c1c75d5b8..d4606bc576 100644 --- a/notes-utils.c +++ b/notes-utils.c @@ -26,7 +26,7 @@ void create_notes_commit(struct repository *r, if (!parents) { /* Deduce parent commit from t->ref */ struct object_id parent_oid; - if (!refs_read_ref(get_main_ref_store(the_repository), t->ref, &parent_oid)) { + if (!refs_read_ref(get_main_ref_store(r), t->ref, &parent_oid)) { struct commit *parent = lookup_commit(r, &parent_oid); if (repo_parse_commit(r, parent)) die("Failed to find/parse commit %s", t->ref); @@ -61,7 +61,7 @@ void commit_notes(struct repository *r, struct notes_tree *t, const char *msg) create_notes_commit(r, t, NULL, buf.buf, buf.len, &commit_oid); strbuf_insertstr(&buf, 0, "notes: "); - refs_update_ref(get_main_ref_store(the_repository), buf.buf, + refs_update_ref(get_main_ref_store(r), buf.buf, t->update_ref, &commit_oid, NULL, 0, UPDATE_REFS_DIE_ON_ERR); -- 2.56.0