]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fast-import.c
transport: use parse_oid_hex instead of a constant
[thirdparty/git.git] / fast-import.c
index f8c3acd3b5577caa24c13402ea2b6f733e41aec5..95600c78e048f9d3d28672737d4bc2a941073abc 100644 (file)
@@ -171,6 +171,7 @@ Format of STDIN stream:
 #include "packfile.h"
 #include "object-store.h"
 #include "mem-pool.h"
+#include "commit-reach.h"
 
 #define PACK_ID_BITS 16
 #define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
@@ -572,7 +573,7 @@ static struct object_entry *find_object(struct object_id *oid)
        unsigned int h = oid->hash[0] << 8 | oid->hash[1];
        struct object_entry *e;
        for (e = object_table[h]; e; e = e->next)
-               if (!oidcmp(oid, &e->idx.oid))
+               if (oideq(oid, &e->idx.oid))
                        return e;
        return NULL;
 }
@@ -583,7 +584,7 @@ static struct object_entry *insert_object(struct object_id *oid)
        struct object_entry *e = object_table[h];
 
        while (e) {
-               if (!oidcmp(oid, &e->idx.oid))
+               if (oideq(oid, &e->idx.oid))
                        return e;
                e = e->next;
        }
@@ -1533,7 +1534,7 @@ static int tree_content_set(
                        if (!*slash1) {
                                if (!S_ISDIR(mode)
                                                && e->versions[1].mode == mode
-                                               && !oidcmp(&e->versions[1].oid, oid))
+                                               && oideq(&e->versions[1].oid, oid))
                                        return 0;
                                e->versions[1].mode = mode;
                                oidcpy(&e->versions[1].oid, oid);
@@ -2649,7 +2650,7 @@ static int parse_from(struct branch *b)
                struct object_entry *oe = find_mark(idnum);
                if (oe->type != OBJ_COMMIT)
                        die("Mark :%" PRIuMAX " not a commit", idnum);
-               if (oidcmp(&b->oid, &oe->idx.oid)) {
+               if (!oideq(&b->oid, &oe->idx.oid)) {
                        oidcpy(&b->oid, &oe->idx.oid);
                        if (oe->pack_id != MAX_PACK_ID) {
                                unsigned long size;
@@ -2667,7 +2668,7 @@ static int parse_from(struct branch *b)
        else
                die("Invalid ref name or SHA1 expression: %s", from);
 
-       if (b->branch_tree.tree && oidcmp(&oid, &b->branch_tree.versions[1].oid)) {
+       if (b->branch_tree.tree && !oideq(&oid, &b->branch_tree.versions[1].oid)) {
                release_tree_content_recursive(b->branch_tree.tree);
                b->branch_tree.tree = NULL;
        }