diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-02-15 14:55:43 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-02-15 14:55:43 -0800 |
| commit | 8be8342b4c47df386c6eced39922595d7dfdccc9 (patch) | |
| tree | 3fed16dd1602125435cf12a4c150698bb13bdf59 /notes-utils.c | |
| parent | 157ee050615192d579a358723563e7f785d676ff (diff) | |
| parent | 1752cbbc447c08230c478239e185db9fa2d4a515 (diff) | |
| download | git-8be8342b4c47df386c6eced39922595d7dfdccc9.tar.xz | |
Merge branch 'po/object-id'
Conversion from uchar[20] to struct object_id continues.
* po/object-id:
sha1_file: rename hash_sha1_file_literally
sha1_file: convert write_loose_object to object_id
sha1_file: convert force_object_loose to object_id
sha1_file: convert write_sha1_file to object_id
notes: convert write_notes_tree to object_id
notes: convert combine_notes_* to object_id
commit: convert commit_tree* to object_id
match-trees: convert splice_tree to object_id
cache: clear whole hash buffer with oidclr
sha1_file: convert hash_sha1_file to object_id
dir: convert struct sha1_stat to use object_id
sha1_file: convert pretend_sha1_file to object_id
Diffstat (limited to 'notes-utils.c')
| -rw-r--r-- | notes-utils.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/notes-utils.c b/notes-utils.c index 5c8e70c98f..02407fe2a7 100644 --- a/notes-utils.c +++ b/notes-utils.c @@ -6,13 +6,13 @@ void create_notes_commit(struct notes_tree *t, struct commit_list *parents, const char *msg, size_t msg_len, - unsigned char *result_sha1) + struct object_id *result_oid) { struct object_id tree_oid; assert(t->initialized); - if (write_notes_tree(t, tree_oid.hash)) + if (write_notes_tree(t, &tree_oid)) die("Failed to write notes tree to database"); if (!parents) { @@ -27,7 +27,8 @@ void create_notes_commit(struct notes_tree *t, struct commit_list *parents, /* else: t->ref points to nothing, assume root/orphan commit */ } - if (commit_tree(msg, msg_len, tree_oid.hash, parents, result_sha1, NULL, NULL)) + if (commit_tree(msg, msg_len, &tree_oid, parents, result_oid, NULL, + NULL)) die("Failed to commit notes tree to database"); } @@ -47,7 +48,7 @@ void commit_notes(struct notes_tree *t, const char *msg) strbuf_addstr(&buf, msg); strbuf_complete_line(&buf); - create_notes_commit(t, NULL, buf.buf, buf.len, commit_oid.hash); + create_notes_commit(t, NULL, buf.buf, buf.len, &commit_oid); strbuf_insert(&buf, 0, "notes: ", 7); /* commit message starts at index 7 */ update_ref(buf.buf, t->update_ref, &commit_oid, NULL, 0, UPDATE_REFS_DIE_ON_ERR); |
