git/bundle-uri.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "bundle-uri.h"
#include "bundle.h"
#include "copy.h"
#include "gettext.h"
#include "refs.h"
#include "run-command.h"
#include "hashmap.h"
#include "pkt-line.h"
#include "config.h"
#include "fetch-pack.h"
#include "remote.h"
#include "trace2.h"
#include "object-store-ll.h"

static struct {} heuristics[BUNDLE_HEURISTIC__COUNT] =;

static int compare_bundles(const void *hashmap_cmp_fn_data UNUSED,
			   const struct hashmap_entry *he1,
			   const struct hashmap_entry *he2,
			   const void *id)
{}

void init_bundle_list(struct bundle_list *list)
{}

static int clear_remote_bundle_info(struct remote_bundle_info *bundle,
				    void *data UNUSED)
{}

void clear_bundle_list(struct bundle_list *list)
{}

int for_all_bundles_in_list(struct bundle_list *list,
			    bundle_iterator iter,
			    void *data)
{}

static int summarize_bundle(struct remote_bundle_info *info, void *data)
{}

void print_bundle_list(FILE *fp, struct bundle_list *list)
{}

/**
 * Given a key-value pair, update the state of the given bundle list.
 * Returns 0 if the key-value pair is understood. Returns -1 if the key
 * is not understood or the value is malformed.
 */
static int bundle_list_update(const char *key, const char *value,
			      struct bundle_list *list)
{}

static int config_to_bundle_list(const char *key, const char *value,
				 const struct config_context *ctx UNUSED,
				 void *data)
{}

int bundle_uri_parse_config_format(const char *uri,
				   const char *filename,
				   struct bundle_list *list)
{}

static char *find_temp_filename(void)
{}

static int download_https_uri_to_file(const char *file, const char *uri)
{}

static int copy_uri_to_file(const char *filename, const char *uri)
{}

static int unbundle_from_file(struct repository *r, const char *file)
{}

struct bundle_list_context {};

/*
 * This early definition is necessary because we use indirect recursion:
 *
 * While iterating through a bundle list that was downloaded as part
 * of fetch_bundle_uri_internal(), iterator methods eventually call it
 * again, but with depth + 1.
 */
static int fetch_bundle_uri_internal(struct repository *r,
				     struct remote_bundle_info *bundle,
				     int depth,
				     struct bundle_list *list);

static int download_bundle_to_file(struct remote_bundle_info *bundle, void *data)
{}

struct bundles_for_sorting {};

static int append_bundle(struct remote_bundle_info *bundle, void *data)
{}

/**
 * For use in QSORT() to get a list sorted by creationToken
 * in decreasing order.
 */
static int compare_creation_token_decreasing(const void *va, const void *vb)
{}

static int fetch_bundles_by_token(struct repository *r,
				  struct bundle_list *list)
{}

static int download_bundle_list(struct repository *r,
				struct bundle_list *local_list,
				struct bundle_list *global_list,
				int depth)
{}

static int fetch_bundle_list_in_config_format(struct repository *r,
					      struct bundle_list *global_list,
					      struct remote_bundle_info *bundle,
					      int depth)
{}

/**
 * This limits the recursion on fetch_bundle_uri_internal() when following
 * bundle lists.
 */
static int max_bundle_uri_depth =;

/**
 * Recursively download all bundles advertised at the given URI
 * to files. If the file is a bundle, then add it to the given
 * 'list'. Otherwise, expect a bundle list and recurse on the
 * URIs in that list according to the list mode (ANY or ALL).
 */
static int fetch_bundle_uri_internal(struct repository *r,
				     struct remote_bundle_info *bundle,
				     int depth,
				     struct bundle_list *list)
{}

/**
 * This loop iterator breaks the loop with nonzero return code on the
 * first successful unbundling of a bundle.
 */
static int attempt_unbundle(struct remote_bundle_info *info, void *data)
{}

static int unbundle_all_bundles(struct repository *r,
				struct bundle_list *list)
{}

static int unlink_bundle(struct remote_bundle_info *info, void *data UNUSED)
{}

int fetch_bundle_uri(struct repository *r, const char *uri,
		     int *has_heuristic)
{}

int fetch_bundle_list(struct repository *r, struct bundle_list *list)
{}

/**
 * API for serve.c.
 */

int bundle_uri_advertise(struct repository *r, struct strbuf *value UNUSED)
{}

static int config_to_packet_line(const char *key, const char *value,
				 const struct config_context *ctx UNUSED,
				 void *data)
{}

int bundle_uri_command(struct repository *r,
		       struct packet_reader *request)
{}

/**
 * General API for {transport,connect}.c etc.
 */
int bundle_uri_parse_line(struct bundle_list *list, const char *line)
{}