diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-05-16 10:10:13 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-16 10:10:14 -0700 |
commit | bca900904d854babf2493d57c0fee3ab421fe750 (patch) | |
tree | e664fba784c58d391ddf22c32222b0212b670171 /notes-utils.c | |
parent | f0e2183768b1548bcaea9e311bb5a54112c0a9f4 (diff) | |
parent | c8f815c2083c4b340d4148a15d45c55f2fcc7d3f (diff) |
Merge branch 'ps/refs-without-the-repository'
The refs API lost functions that implicitly assumes to work on the
primary ref_store by forcing the callers to pass a ref_store as an
argument.
* ps/refs-without-the-repository:
refs: remove functions without ref store
cocci: apply rules to rewrite callers of "refs" interfaces
cocci: introduce rules to transform "refs" to pass ref store
refs: add `exclude_patterns` parameter to `for_each_fullref_in()`
refs: introduce missing functions that accept a `struct ref_store`
Diffstat (limited to 'notes-utils.c')
-rw-r--r-- | notes-utils.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/notes-utils.c b/notes-utils.c index 6197a5a455..e33aa86c4b 100644 --- a/notes-utils.c +++ b/notes-utils.c @@ -23,7 +23,7 @@ void create_notes_commit(struct repository *r, if (!parents) { /* Deduce parent commit from t->ref */ struct object_id parent_oid; - if (!read_ref(t->ref, &parent_oid)) { + if (!refs_read_ref(get_main_ref_store(the_repository), 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); @@ -55,8 +55,9 @@ 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: "); - update_ref(buf.buf, t->update_ref, &commit_oid, NULL, 0, - UPDATE_REFS_DIE_ON_ERR); + refs_update_ref(get_main_ref_store(the_repository), buf.buf, + t->update_ref, &commit_oid, NULL, 0, + UPDATE_REFS_DIE_ON_ERR); strbuf_release(&buf); } |