builtin/apply: move 'state' init into init_apply_state()
[gitweb.git] / notes.c
diff --git a/notes.c b/notes.c
index c1e503559076398b1edc5fabbaab8f3cac5ac7d6..e4e4854d69fb965e68a712dd342121d3276be945 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -446,7 +446,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
                        l = (struct leaf_node *)
                                xcalloc(1, sizeof(struct leaf_node));
                        hashcpy(l->key_sha1, object_sha1);
-                       hashcpy(l->val_sha1, entry.sha1);
+                       hashcpy(l->val_sha1, entry.oid->hash);
                        if (len < 20) {
                                if (!S_ISDIR(entry.mode) || path_len != 2)
                                        goto handle_non_note; /* not subtree */
@@ -493,7 +493,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
                        }
                        strbuf_addstr(&non_note_path, entry.path);
                        add_non_note(t, strbuf_detach(&non_note_path, NULL),
-                                    entry.mode, entry.sha1);
+                                    entry.mode, entry.oid->hash);
                }
        }
        free(buf);
@@ -1035,7 +1035,7 @@ struct notes_tree **load_notes_trees(struct string_list *refs, int flags)
        struct string_list_item *item;
        int counter = 0;
        struct notes_tree **trees;
-       trees = xmalloc((refs->nr+1) * sizeof(struct notes_tree *));
+       ALLOC_ARRAY(trees, refs->nr + 1);
        for_each_string_list_item(item, refs) {
                struct notes_tree *t = xcalloc(1, sizeof(struct notes_tree));
                init_notes(t, item->string, combine_notes_ignore, flags);