#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "config.h"
#include "gettext.h"
#include "git-zlib.h"
#include "hex.h"
#include "tar.h"
#include "archive.h"
#include "object-store-ll.h"
#include "strbuf.h"
#include "streaming.h"
#include "run-command.h"
#include "write-or-die.h"
#define RECORDSIZE …
#define BLOCKSIZE …
static char block[BLOCKSIZE];
static unsigned long offset;
static int tar_umask = …;
static int write_tar_filter_archive(const struct archiver *ar,
struct archiver_args *args);
#if ULONG_MAX == 0xFFFFFFFF
#define USTAR_MAX_SIZE …
#else
#define USTAR_MAX_SIZE …
#endif
#if TIME_MAX == 0xFFFFFFFF
#define USTAR_MAX_MTIME …
#else
#define USTAR_MAX_MTIME …
#endif
static void tar_write_block(const void *buf)
{ … }
static void (*write_block)(const void *) = …;
static void write_if_needed(void)
{ … }
static void do_write_blocked(const void *data, unsigned long size)
{ … }
static void finish_record(void)
{ … }
static void write_blocked(const void *data, unsigned long size)
{ … }
static void write_trailer(void)
{ … }
static int stream_blocked(struct repository *r, const struct object_id *oid)
{ … }
static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword,
const char *value, size_t valuelen)
{ … }
static void strbuf_append_ext_header_uint(struct strbuf *sb,
const char *keyword,
uintmax_t value)
{ … }
static unsigned int ustar_header_chksum(const struct ustar_header *header)
{ … }
static size_t get_path_prefix(const char *path, size_t pathlen, size_t maxlen)
{ … }
static void prepare_header(struct archiver_args *args,
struct ustar_header *header,
unsigned int mode, unsigned long size)
{ … }
static void write_extended_header(struct archiver_args *args,
const struct object_id *oid,
const void *buffer, unsigned long size)
{ … }
static int write_tar_entry(struct archiver_args *args,
const struct object_id *oid,
const char *path, size_t pathlen,
unsigned int mode,
void *buffer, unsigned long size)
{ … }
static void write_global_extended_header(struct archiver_args *args)
{ … }
static struct archiver **tar_filters;
static int nr_tar_filters;
static int alloc_tar_filters;
static struct archiver *find_tar_filter(const char *name, size_t len)
{ … }
static int tar_filter_config(const char *var, const char *value,
void *data UNUSED)
{ … }
static int git_tar_config(const char *var, const char *value,
const struct config_context *ctx, void *cb)
{ … }
static int write_tar_archive(const struct archiver *ar UNUSED,
struct archiver_args *args)
{ … }
static git_zstream gzstream;
static unsigned char outbuf[16384];
static void tgz_deflate(int flush)
{ … }
static void tgz_write_block(const void *data)
{ … }
static const char internal_gzip_command[] = …;
static int write_tar_filter_archive(const struct archiver *ar,
struct archiver_args *args)
{ … }
static struct archiver tar_archiver = …;
void init_tar_archiver(void)
{ … }