commit: convert register_commit_graft to handle arbitrary repositories
[gitweb.git] / archive-tar.c
index 24b1ccef3af472c2e4de2f35a805b84be0ea5478..e38435eb4ef93bb0805b407c01722e22f4a9706b 100644 (file)
@@ -5,6 +5,7 @@
 #include "config.h"
 #include "tar.h"
 #include "archive.h"
+#include "object-store.h"
 #include "streaming.h"
 #include "run-command.h"
 
@@ -119,7 +120,7 @@ static int stream_blocked(const struct object_id *oid)
        char buf[BLOCKSIZE];
        ssize_t readlen;
 
-       st = open_istream(oid->hash, &type, &sz, NULL);
+       st = open_istream(oid, &type, &sz, NULL);
        if (!st)
                return error("cannot stream blob %s", oid_to_hex(oid));
        for (;;) {
@@ -276,12 +277,12 @@ static int write_tar_entry(struct archiver_args *args,
                memcpy(header.name, path, pathlen);
 
        if (S_ISREG(mode) && !args->convert &&
-           sha1_object_info(oid->hash, &size) == OBJ_BLOB &&
+           oid_object_info(the_repository, oid, &size) == OBJ_BLOB &&
            size > big_file_threshold)
                buffer = NULL;
        else if (S_ISLNK(mode) || S_ISREG(mode)) {
                enum object_type type;
-               buffer = sha1_file_to_archive(args, path, oid->hash, old_mode, &type, &size);
+               buffer = object_file_to_archive(args, path, oid, old_mode, &type, &size);
                if (!buffer)
                        return error("cannot read %s", oid_to_hex(oid));
        } else {