git/tmp-objdir.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "tmp-objdir.h"
#include "abspath.h"
#include "chdir-notify.h"
#include "dir.h"
#include "environment.h"
#include "object-file.h"
#include "path.h"
#include "string-list.h"
#include "strbuf.h"
#include "strvec.h"
#include "quote.h"
#include "object-store-ll.h"
#include "repository.h"

struct tmp_objdir {};

/*
 * Allow only one tmp_objdir at a time in a running process, which simplifies
 * our atexit cleanup routines.  It's doubtful callers will ever need
 * more than one, and we can expand later if so.  You can have many such
 * tmp_objdirs simultaneously in many processes, of course.
 */
static struct tmp_objdir *the_tmp_objdir;

static void tmp_objdir_free(struct tmp_objdir *t)
{}

int tmp_objdir_destroy(struct tmp_objdir *t)
{}

static void remove_tmp_objdir(void)
{}

void tmp_objdir_discard_objects(struct tmp_objdir *t)
{}

/*
 * These env_* functions are for setting up the child environment; the
 * "replace" variant overrides the value of any existing variable with that
 * "key". The "append" variant puts our new value at the end of a list,
 * separated by PATH_SEP (which is what separate values in
 * GIT_ALTERNATE_OBJECT_DIRECTORIES).
 */
static void env_append(struct strvec *env, const char *key, const char *val)
{}

static void env_replace(struct strvec *env, const char *key, const char *val)
{}

static int setup_tmp_objdir(const char *root)
{}

struct tmp_objdir *tmp_objdir_create(const char *prefix)
{}

/*
 * Make sure we copy packfiles and their associated metafiles in the correct
 * order. All of these ends_with checks are slightly expensive to do in
 * the midst of a sorting routine, but in practice it shouldn't matter.
 * We will have a relatively small number of packfiles to order, and loose
 * objects exit early in the first line.
 */
static int pack_copy_priority(const char *name)
{}

static int pack_copy_cmp(const char *a, const char *b)
{}

static int read_dir_paths(struct string_list *out, const char *path)
{}

static int migrate_paths(struct strbuf *src, struct strbuf *dst,
			 enum finalize_object_file_flags flags);

static int migrate_one(struct strbuf *src, struct strbuf *dst,
		       enum finalize_object_file_flags flags)
{}

static int is_loose_object_shard(const char *name)
{}

static int migrate_paths(struct strbuf *src, struct strbuf *dst,
			 enum finalize_object_file_flags flags)
{}

int tmp_objdir_migrate(struct tmp_objdir *t)
{}

const char **tmp_objdir_env(const struct tmp_objdir *t)
{}

void tmp_objdir_add_as_alternate(const struct tmp_objdir *t)
{}

void tmp_objdir_replace_primary_odb(struct tmp_objdir *t, int will_destroy)
{}

struct tmp_objdir *tmp_objdir_unapply_primary_odb(void)
{}

void tmp_objdir_reapply_primary_odb(struct tmp_objdir *t, const char *old_cwd,
		const char *new_cwd)
{}