git/repository.c

#include "git-compat-util.h"
#include "abspath.h"
#include "repository.h"
#include "object-store-ll.h"
#include "config.h"
#include "object.h"
#include "lockfile.h"
#include "path.h"
#include "read-cache-ll.h"
#include "remote.h"
#include "setup.h"
#include "loose.h"
#include "submodule-config.h"
#include "sparse-index.h"
#include "trace2.h"
#include "promisor-remote.h"
#include "refs.h"

/*
 * We do not define `USE_THE_REPOSITORY_VARIABLE` in this file because we do
 * not want to rely on functions that implicitly use `the_repository`. This
 * means that the `extern` declaration of `the_repository` isn't visible here,
 * which makes sparse unhappy. We thus declare it here.
 */
extern struct repository *the_repository;

/* The main repository */
static struct repository the_repo;
struct repository *the_repository =;

/*
 * An escape hatch: if we hit a bug in the production code that fails
 * to set an appropriate hash algorithm (most likely to happen when
 * running outside a repository), we can tell the user who reported
 * the crash to set the environment variable to "sha1" (all lowercase)
 * to revert to the historical behaviour of defaulting to SHA-1.
 */
static void set_default_hash_algo(struct repository *repo)
{}

void initialize_repository(struct repository *repo)
{}

static void expand_base_dir(char **out, const char *in,
			    const char *base_dir, const char *def_in)
{}

const char *repo_get_git_dir(struct repository *repo)
{}

const char *repo_get_common_dir(struct repository *repo)
{}

const char *repo_get_object_directory(struct repository *repo)
{}

const char *repo_get_index_file(struct repository *repo)
{}

const char *repo_get_graft_file(struct repository *repo)
{}

const char *repo_get_work_tree(struct repository *repo)
{}

static void repo_set_commondir(struct repository *repo,
			       const char *commondir)
{}

void repo_set_gitdir(struct repository *repo,
		     const char *root,
		     const struct set_gitdir_args *o)
{}

void repo_set_hash_algo(struct repository *repo, int hash_algo)
{}

void repo_set_compat_hash_algo(struct repository *repo, int algo)
{}

void repo_set_ref_storage_format(struct repository *repo,
				 enum ref_storage_format format)
{}

/*
 * Attempt to resolve and set the provided 'gitdir' for repository 'repo'.
 * Return 0 upon success and a non-zero value upon failure.
 */
static int repo_init_gitdir(struct repository *repo, const char *gitdir)
{}

void repo_set_worktree(struct repository *repo, const char *path)
{}

static int read_and_verify_repository_format(struct repository_format *format,
					     const char *commondir)
{}

/*
 * Initialize 'repo' based on the provided 'gitdir'.
 * Return 0 upon success and a non-zero value upon failure.
 */
int repo_init(struct repository *repo,
	      const char *gitdir,
	      const char *worktree)
{}

int repo_submodule_init(struct repository *subrepo,
			struct repository *superproject,
			const char *path,
			const struct object_id *treeish_name)
{}

static void repo_clear_path_cache(struct repo_path_cache *cache)
{}

void repo_clear(struct repository *repo)
{}

int repo_read_index(struct repository *repo)
{}

int repo_hold_locked_index(struct repository *repo,
			   struct lock_file *lf,
			   int flags)
{}