sequencer: refactor transform_todos() to work on a todo_list
[gitweb.git] / archive-tar.c
index 68e72d91765c64a98646bc503b17ead64ef61692..a58e1a8ebf874afc856b03f2203ee32d79183b31 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"
 
@@ -201,7 +202,7 @@ static void prepare_header(struct archiver_args *args,
                           unsigned int mode, unsigned long size)
 {
        xsnprintf(header->mode, sizeof(header->mode), "%07o", mode & 07777);
-       xsnprintf(header->size, sizeof(header->size), "%011lo", S_ISREG(mode) ? size : 0);
+       xsnprintf(header->size, sizeof(header->size), "%011"PRIoMAX , S_ISREG(mode) ? (uintmax_t)size : (uintmax_t)0);
        xsnprintf(header->mtime, sizeof(header->mtime), "%011lo", (unsigned long) args->time);
 
        xsnprintf(header->uid, sizeof(header->uid), "%07o", 0);
@@ -276,7 +277,7 @@ static int write_tar_entry(struct archiver_args *args,
                memcpy(header.name, path, pathlen);
 
        if (S_ISREG(mode) && !args->convert &&
-           oid_object_info(the_repository, oid, &size) == OBJ_BLOB &&
+           oid_object_info(args->repo, oid, &size) == OBJ_BLOB &&
            size > big_file_threshold)
                buffer = NULL;
        else if (S_ISLNK(mode) || S_ISREG(mode)) {