rebase: consolidate clean-up code before leaving reset_head()
[gitweb.git] / xdiff-interface.c
index 770e1f7f8185e05f2618c261b70a5773041432fb..e7af95db8654a88359b9abd31bc018fb1cb66b5f 100644 (file)
@@ -1,5 +1,6 @@
 #include "cache.h"
 #include "config.h"
+#include "object-store.h"
 #include "xdiff-interface.h"
 #include "xdiff/xtypes.h"
 #include "xdiff/xdiffi.h"
@@ -185,13 +186,13 @@ void read_mmblob(mmfile_t *ptr, const struct object_id *oid)
        unsigned long size;
        enum object_type type;
 
-       if (!oidcmp(oid, &null_oid)) {
+       if (oideq(oid, &null_oid)) {
                ptr->ptr = xstrdup("");
                ptr->size = 0;
                return;
        }
 
-       ptr->ptr = read_sha1_file(oid->hash, &type, &size);
+       ptr->ptr = read_object_file(oid, &type, &size);
        if (!ptr->ptr || type != OBJ_BLOB)
                die("unable to read blob object %s", oid_to_hex(oid));
        ptr->size = size;