Skip to content

Commit 13ac141

Browse files
bk2204gitster
authored andcommitted
notes: convert init_notes to use struct object_id
Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8ec46d7 commit 13ac141

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

notes.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ const char *default_notes_ref(void)
993993
void init_notes(struct notes_tree *t, const char *notes_ref,
994994
combine_notes_fn combine_notes, int flags)
995995
{
996-
unsigned char sha1[20], object_sha1[20];
996+
struct object_id oid, object_oid;
997997
unsigned mode;
998998
struct leaf_node root_tree;
999999

@@ -1017,16 +1017,16 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
10171017
t->dirty = 0;
10181018

10191019
if (flags & NOTES_INIT_EMPTY || !notes_ref ||
1020-
get_sha1_treeish(notes_ref, object_sha1))
1020+
get_sha1_treeish(notes_ref, object_oid.hash))
10211021
return;
1022-
if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, object_sha1))
1022+
if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, object_oid.hash))
10231023
die("Cannot use notes ref %s", notes_ref);
1024-
if (get_tree_entry(object_sha1, "", sha1, &mode))
1024+
if (get_tree_entry(object_oid.hash, "", oid.hash, &mode))
10251025
die("Failed to read notes tree referenced by %s (%s)",
1026-
notes_ref, sha1_to_hex(object_sha1));
1026+
notes_ref, oid_to_hex(&object_oid));
10271027

10281028
hashclr(root_tree.key_sha1);
1029-
hashcpy(root_tree.val_sha1, sha1);
1029+
hashcpy(root_tree.val_sha1, oid.hash);
10301030
load_subtree(t, &root_tree, t->root, 0);
10311031
}
10321032

0 commit comments

Comments
 (0)