git/match-trees.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "hex.h"
#include "match-trees.h"
#include "strbuf.h"
#include "tree.h"
#include "tree-walk.h"
#include "object-store-ll.h"

static int score_missing(unsigned mode)
{}

static int score_differs(unsigned mode1, unsigned mode2)
{}

static int score_matches(unsigned mode1, unsigned mode2)
{}

static void *fill_tree_desc_strict(struct tree_desc *desc,
				   const struct object_id *hash)
{}

static int base_name_entries_compare(const struct name_entry *a,
				     const struct name_entry *b)
{}

/*
 * Inspect two trees, and give a score that tells how similar they are.
 */
static int score_trees(const struct object_id *hash1, const struct object_id *hash2)
{}

/*
 * Match one itself and its subtrees with two and pick the best match.
 */
static void match_trees(const struct object_id *hash1,
			const struct object_id *hash2,
			int *best_score,
			char **best_match,
			const char *base,
			int recurse_limit)
{}

/*
 * A tree "oid1" has a subdirectory at "prefix".  Come up with a tree object by
 * replacing it with another tree "oid2".
 */
static int splice_tree(const struct object_id *oid1, const char *prefix,
		       const struct object_id *oid2, struct object_id *result)
{}

/*
 * We are trying to come up with a merge between one and two that
 * results in a tree shape similar to one.  The tree two might
 * correspond to a subtree of one, in which case it needs to be
 * shifted down by prefixing otherwise empty directories.  On the
 * other hand, it could cover tree one and we might need to pick a
 * subtree of it.
 */
void shift_tree(struct repository *r,
		const struct object_id *hash1,
		const struct object_id *hash2,
		struct object_id *shifted,
		int depth_limit)
{}

/*
 * The user says the trees will be shifted by this much.
 * Unfortunately we cannot fundamentally tell which one to
 * be prefixed, as recursive merge can work in either direction.
 */
void shift_tree_by(struct repository *r,
		   const struct object_id *hash1,
		   const struct object_id *hash2,
		   struct object_id *shifted,
		   const char *shift_prefix)
{}