pretty: allow showing specific trailers
[gitweb.git] / archive-tar.c
index b6f58ddf38767d86f866bd9413292e279c6cfa73..7a535cba24a2a0535b412f1cfb3531ddde155c1e 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"
 
@@ -121,7 +122,7 @@ static int stream_blocked(const struct object_id *oid)
 
        st = open_istream(oid, &type, &sz, NULL);
        if (!st)
-               return error("cannot stream blob %s", oid_to_hex(oid));
+               return error(_("cannot stream blob %s"), oid_to_hex(oid));
        for (;;) {
                readlen = read_istream(st, buf, sizeof(buf));
                if (readlen <= 0)
@@ -256,7 +257,7 @@ static int write_tar_entry(struct archiver_args *args,
                *header.typeflag = TYPEFLAG_REG;
                mode = (mode | ((mode & 0100) ? 0777 : 0666)) & ~tar_umask;
        } else {
-               return error("unsupported file mode: 0%o (SHA1: %s)",
+               return error(_("unsupported file mode: 0%o (SHA1: %s)"),
                             mode, oid_to_hex(oid));
        }
        if (pathlen > sizeof(header.name)) {
@@ -276,14 +277,14 @@ 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)) {
                enum object_type type;
                buffer = object_file_to_archive(args, path, oid, old_mode, &type, &size);
                if (!buffer)
-                       return error("cannot read %s", oid_to_hex(oid));
+                       return error(_("cannot read %s"), oid_to_hex(oid));
        } else {
                buffer = NULL;
                size = 0;
@@ -454,17 +455,17 @@ static int write_tar_filter_archive(const struct archiver *ar,
        filter.in = -1;
 
        if (start_command(&filter) < 0)
-               die_errno("unable to start '%s' filter", argv[0]);
+               die_errno(_("unable to start '%s' filter"), argv[0]);
        close(1);
        if (dup2(filter.in, 1) < 0)
-               die_errno("unable to redirect descriptor");
+               die_errno(_("unable to redirect descriptor"));
        close(filter.in);
 
        r = write_tar_archive(ar, args);
 
        close(1);
        if (finish_command(&filter) != 0)
-               die("'%s' filter reported error", argv[0]);
+               die(_("'%s' filter reported error"), argv[0]);
 
        strbuf_release(&cmd);
        return r;