Merge branch 'bw/diff-opt-impl-to-bitfields'
[gitweb.git] / notes-utils.c
index 7d7c22b4351a07b703865b97cfbc0ed2083f7a38..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);
@@ -132,8 +133,11 @@ struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd)
                c->mode_from_env = 1;
                c->combine = parse_combine_notes_fn(rewrite_mode_env);
                if (!c->combine)
-                       /* TRANSLATORS: The first %s is the name of the
-                          environment variable, the second %s is its value */
+                       /*
+                        * TRANSLATORS: The first %s is the name of
+                        * the environment variable, the second %s is
+                        * its value.
+                        */
                        error(_("Bad %s value: '%s'"), GIT_NOTES_REWRITE_MODE_ENVIRONMENT,
                                        rewrite_mode_env);
        }
@@ -160,7 +164,7 @@ int copy_note_for_rewrite(struct notes_rewrite_cfg *c,
        int ret = 0;
        int i;
        for (i = 0; c->trees[i]; i++)
-               ret = copy_note(c->trees[i], from_obj->hash, to_obj->hash, 1, c->combine) || ret;
+               ret = copy_note(c->trees[i], from_obj, to_obj, 1, c->combine) || ret;
        return ret;
 }