Merge branch 'bw/diff-opt-impl-to-bitfields'
[gitweb.git] / notes-utils.c
index 031503d7b2ba9217cffa52652b57aa063208fb1a..5c8e70c98fd26cca8bc690bc92653dd578a78c92 100644 (file)
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "config.h"
 #include "commit.h"
 #include "refs.h"
 #include "notes-utils.h"
@@ -17,7 +18,7 @@ void create_notes_commit(struct notes_tree *t, struct commit_list *parents,
        if (!parents) {
                /* Deduce parent commit from t->ref */
                struct object_id parent_oid;
-               if (!read_ref(t->ref, parent_oid.hash)) {
+               if (!read_ref(t->ref, &parent_oid)) {
                        struct commit *parent = lookup_commit(&parent_oid);
                        if (parse_commit(parent))
                                die("Failed to find/parse commit %s", t->ref);
@@ -48,7 +49,7 @@ void commit_notes(struct notes_tree *t, const char *msg)
 
        create_notes_commit(t, NULL, buf.buf, buf.len, commit_oid.hash);
        strbuf_insert(&buf, 0, "notes: ", 7); /* commit message starts at index 7 */
-       update_ref(buf.buf, t->update_ref, commit_oid.hash, NULL, 0,
+       update_ref(buf.buf, t->update_ref, &commit_oid, NULL, 0,
                   UPDATE_REFS_DIE_ON_ERR);
 
        strbuf_release(&buf);
@@ -158,7 +159,7 @@ struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd)
 }
 
 int copy_note_for_rewrite(struct notes_rewrite_cfg *c,
-                         const unsigned char *from_obj, const unsigned char *to_obj)
+                         const struct object_id *from_obj, const struct object_id *to_obj)
 {
        int ret = 0;
        int i;