Merge branch 'ma/reduce-heads-leakfix'
[gitweb.git] / fast-import.c
index 32ac5323f6310e40595df23b77698dea1622f9fa..b70ac025e0428b239c9cb8b8a70dda70c0cc1007 100644 (file)
@@ -167,6 +167,7 @@ Format of STDIN stream:
 #include "quote.h"
 #include "dir.h"
 #include "run-command.h"
+#include "packfile.h"
 
 #define PACK_ID_BITS 16
 #define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
@@ -1757,7 +1758,7 @@ static int update_branch(struct branch *b)
                        delete_ref(NULL, b->name, NULL, 0);
                return 0;
        }
-       if (read_ref(b->name, old_oid.hash))
+       if (read_ref(b->name, &old_oid))
                oidclr(&old_oid);
        if (!force_update && !is_null_oid(&old_oid)) {
                struct commit *old_cmit, *new_cmit;
@@ -1777,7 +1778,7 @@ static int update_branch(struct branch *b)
        }
        transaction = ref_transaction_begin(&err);
        if (!transaction ||
-           ref_transaction_update(transaction, b->name, b->oid.hash, old_oid.hash,
+           ref_transaction_update(transaction, b->name, &b->oid, &old_oid,
                                   0, msg, &err) ||
            ref_transaction_commit(transaction, &err)) {
                ref_transaction_free(transaction);
@@ -1819,7 +1820,7 @@ static void dump_tags(void)
                strbuf_addf(&ref_name, "refs/tags/%s", t->name);
 
                if (ref_transaction_update(transaction, ref_name.buf,
-                                          t->oid.hash, NULL, 0, msg, &err)) {
+                                          &t->oid, NULL, 0, msg, &err)) {
                        failure |= error("%s", err.buf);
                        goto cleanup;
                }