#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "bulk-checkin.h"
#include "config.h"
#include "environment.h"
#include "gettext.h"
#include "git-zlib.h"
#include "hex.h"
#include "object-store-ll.h"
#include "object.h"
#include "delta.h"
#include "pack.h"
#include "blob.h"
#include "replace-object.h"
#include "strbuf.h"
#include "progress.h"
#include "decorate.h"
#include "fsck.h"
static int dry_run, quiet, recover, has_errors, strict;
static const char unpack_usage[] = …;
static unsigned char buffer[4096];
static unsigned int offset, len;
static off_t consumed_bytes;
static off_t max_input_size;
static git_hash_ctx ctx;
static struct fsck_options fsck_options = …;
static struct progress *progress;
struct obj_buffer { … };
static struct decoration obj_decorate;
static struct obj_buffer *lookup_object_buffer(struct object *base)
{ … }
static void add_object_buffer(struct object *object, char *buffer, unsigned long size)
{ … }
static void *fill(int min)
{ … }
static void use(int bytes)
{ … }
static void *get_data(unsigned long size)
{ … }
struct delta_info { … };
static struct delta_info *delta_list;
static void add_delta_to_list(unsigned nr, const struct object_id *base_oid,
off_t base_offset,
void *delta, unsigned long size)
{ … }
struct obj_info { … };
#define FLAG_OPEN …
#define FLAG_WRITTEN …
static struct obj_info *obj_list;
static unsigned nr_objects;
static void write_cached_object(struct object *obj, struct obj_buffer *obj_buf)
{ … }
static int check_object(struct object *obj, enum object_type type,
void *data UNUSED,
struct fsck_options *options UNUSED)
{ … }
static void write_rest(void)
{ … }
static void added_object(unsigned nr, enum object_type type,
void *data, unsigned long size);
static void write_object(unsigned nr, enum object_type type,
void *buf, unsigned long size)
{ … }
static void resolve_delta(unsigned nr, enum object_type type,
void *base, unsigned long base_size,
void *delta, unsigned long delta_size)
{ … }
static void added_object(unsigned nr, enum object_type type,
void *data, unsigned long size)
{ … }
static void unpack_non_delta_entry(enum object_type type, unsigned long size,
unsigned nr)
{ … }
struct input_zstream_data { … };
static const void *feed_input_zstream(struct input_stream *in_stream,
unsigned long *readlen)
{ … }
static void stream_blob(unsigned long size, unsigned nr)
{ … }
static int resolve_against_held(unsigned nr, const struct object_id *base,
void *delta_data, unsigned long delta_size)
{ … }
static void unpack_delta_entry(enum object_type type, unsigned long delta_size,
unsigned nr)
{ … }
static void unpack_one(unsigned nr)
{ … }
static void unpack_all(void)
{ … }
int cmd_unpack_objects(int argc,
const char **argv,
const char *prefix UNUSED,
struct repository *repo UNUSED)
{ … }