git/sparse-index.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "environment.h"
#include "ewah/ewok.h"
#include "gettext.h"
#include "name-hash.h"
#include "read-cache-ll.h"
#include "repository.h"
#include "sparse-index.h"
#include "tree.h"
#include "pathspec.h"
#include "trace2.h"
#include "cache-tree.h"
#include "config.h"
#include "dir.h"
#include "fsmonitor-ll.h"
#include "advice.h"

/**
 * This global is used by expand_index() to determine if we should give the
 * advice for advice.sparseIndexExpanded when expanding a sparse index to a full
 * one. However, this is sometimes done on purpose, such as in the sparse-checkout
 * builtin, even when index.sparse=false. This may be disabled in
 * convert_to_sparse() or by commands that know they will lead to a full
 * expansion, but this message is not actionable.
 */
int give_advice_on_expansion =;
#define ADVICE_MSG

struct modify_index_context {};

static struct cache_entry *construct_sparse_dir_entry(
				struct index_state *istate,
				const char *sparse_dir,
				struct cache_tree *tree)
{}

/*
 * Returns the number of entries "inserted" into the index.
 */
static int convert_to_sparse_rec(struct index_state *istate,
				 int num_converted,
				 int start, int end,
				 const char *ct_path, size_t ct_pathlen,
				 struct cache_tree *ct)
{}

int set_sparse_index_config(struct repository *repo, int enable)
{}

static int index_has_unmerged_entries(struct index_state *istate)
{}

int is_sparse_index_allowed(struct index_state *istate, int flags)
{}

int convert_to_sparse(struct index_state *istate, int flags)
{}

static void set_index_entry(struct index_state *istate, int nr, struct cache_entry *ce)
{}

static int add_path_to_index(const struct object_id *oid,
			     struct strbuf *base, const char *path,
			     unsigned int mode, void *context)
{}

void expand_index(struct index_state *istate, struct pattern_list *pl)
{}

void ensure_full_index(struct index_state *istate)
{}

void ensure_correct_sparsity(struct index_state *istate)
{}

struct path_found_data {};

#define PATH_FOUND_DATA_INIT

static void clear_path_found_data(struct path_found_data *data)
{}

/**
 * Return the length of the longest common substring that ends in a
 * slash ('/') to indicate the longest common parent directory. Returns
 * zero if no common directory exists.
 */
static size_t max_common_dir_prefix(const char *path1, const char *path2)
{}

static int path_found(const char *path, struct path_found_data *data)
{}

static int clear_skip_worktree_from_present_files_sparse(struct index_state *istate)
{}

static void clear_skip_worktree_from_present_files_full(struct index_state *istate)
{}

void clear_skip_worktree_from_present_files(struct index_state *istate)
{}

/*
 * This static global helps avoid infinite recursion between
 * expand_to_path() and index_file_exists().
 */
static int in_expand_to_path =;

void expand_to_path(struct index_state *istate,
		    const char *path, size_t pathlen, int icase)
{}