git/upload-pack.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "refs.h"
#include "pkt-line.h"
#include "sideband.h"
#include "repository.h"
#include "object-store-ll.h"
#include "oid-array.h"
#include "object.h"
#include "commit.h"
#include "diff.h"
#include "revision.h"
#include "list-objects-filter-options.h"
#include "run-command.h"
#include "connect.h"
#include "sigchain.h"
#include "version.h"
#include "string-list.h"
#include "strvec.h"
#include "trace2.h"
#include "protocol.h"
#include "upload-pack.h"
#include "commit-graph.h"
#include "commit-reach.h"
#include "shallow.h"
#include "write-or-die.h"
#include "json-writer.h"
#include "strmap.h"

/* Remember to update object flag allocation in object.h */
#define THEY_HAVE
#define OUR_REF
#define WANTED
#define COMMON_KNOWN

#define SHALLOW
#define NOT_SHALLOW
#define CLIENT_SHALLOW
#define HIDDEN_REF

#define ALL_FLAGS

/* Enum for allowed unadvertised object request (UOR) */
enum allow_uor {};

/*
 * Please annotate, and if possible group together, fields used only
 * for protocol v0 or only for protocol v2.
 */
struct upload_pack_data {};

static void upload_pack_data_init(struct upload_pack_data *data)
{}

static void upload_pack_data_clear(struct upload_pack_data *data)
{}

static void reset_timeout(unsigned int timeout)
{}

static void send_client_data(int fd, const char *data, ssize_t sz,
			     int use_sideband)
{}

static int write_one_shallow(const struct commit_graft *graft, void *cb_data)
{}

struct output_state {};

static int relay_pack_data(int pack_objects_out, struct output_state *os,
			   int use_sideband, int write_packfile_line)
{}

static void create_pack_file(struct upload_pack_data *pack_data,
			     const struct string_list *uri_protocols)
{}

static int do_got_oid(struct upload_pack_data *data, const struct object_id *oid)
{}

static int got_oid(struct upload_pack_data *data,
		   const char *hex, struct object_id *oid)
{}

static int ok_to_give_up(struct upload_pack_data *data)
{}

static int get_common_commits(struct upload_pack_data *data,
			      struct packet_reader *reader)
{}

static int allow_hidden_refs(enum allow_uor allow_uor)
{}

static void for_each_namespaced_ref_1(each_ref_fn fn,
				      struct upload_pack_data *data)
{}


static int is_our_ref(struct object *o, enum allow_uor allow_uor)
{}

/*
 * on successful case, it's up to the caller to close cmd->out
 */
static int do_reachable_revlist(struct child_process *cmd,
				struct object_array *src,
				struct object_array *reachable,
				enum allow_uor allow_uor)
{}

static int get_reachable_list(struct upload_pack_data *data,
			      struct object_array *reachable)
{}

static int has_unreachable(struct object_array *src, enum allow_uor allow_uor)
{}

static void check_non_tip(struct upload_pack_data *data)
{}

static void send_shallow(struct upload_pack_data *data,
			 struct commit_list *result)
{}

static void send_unshallow(struct upload_pack_data *data)
{}

static int check_ref(const char *refname_full, const char *referent UNUSED, const struct object_id *oid,
		     int flag, void *cb_data);
static void deepen(struct upload_pack_data *data, int depth)
{}

static void deepen_by_rev_list(struct upload_pack_data *data,
			       int ac,
			       const char **av)
{}

/* Returns 1 if a shallow list is sent or 0 otherwise */
static int send_shallow_list(struct upload_pack_data *data)
{}

static int process_shallow(const char *line, struct object_array *shallows)
{}

static int process_deepen(const char *line, int *depth)
{}

static int process_deepen_since(const char *line, timestamp_t *deepen_since, int *deepen_rev_list)
{}

static int process_deepen_not(const char *line, struct oidset *deepen_not, int *deepen_rev_list)
{}

NORETURN __attribute__((format(printf,2,3)))
static void send_err_and_die(struct upload_pack_data *data,
			     const char *fmt, ...)
{}

static void check_one_filter(struct upload_pack_data *data,
			     struct list_objects_filter_options *opts)
{}

static void check_filter_recurse(struct upload_pack_data *data,
				 struct list_objects_filter_options *opts)
{}

static void die_if_using_banned_filter(struct upload_pack_data *data)
{}

static void receive_needs(struct upload_pack_data *data,
			  struct packet_reader *reader)
{}

/* return non-zero if the ref is hidden, otherwise 0 */
static int mark_our_ref(const char *refname, const char *refname_full,
			const struct object_id *oid, const struct strvec *hidden_refs)
{}

static int check_ref(const char *refname_full, const char *referent UNUSED,const struct object_id *oid,
		     int flag UNUSED, void *cb_data)
{}

static void format_symref_info(struct strbuf *buf, struct string_list *symref)
{}

static void format_session_id(struct strbuf *buf, struct upload_pack_data *d) {}

static void write_v0_ref(struct upload_pack_data *data,
			const char *refname, const char *refname_nons,
			const struct object_id *oid)
{}

static int send_ref(const char *refname, const char *referent UNUSED, const struct object_id *oid,
		    int flag UNUSED, void *cb_data)
{}

static int find_symref(const char *refname, const char *referent UNUSED,
		       const struct object_id *oid UNUSED,
		       int flag, void *cb_data)
{}

static int parse_object_filter_config(const char *var, const char *value,
				      const struct key_value_info *kvi,
				      struct upload_pack_data *data)
{}

static int upload_pack_config(const char *var, const char *value,
			      const struct config_context *ctx,
			      void *cb_data)
{}

static int upload_pack_protected_config(const char *var, const char *value,
					const struct config_context *ctx UNUSED,
					void *cb_data)
{}

static void get_upload_pack_config(struct repository *r,
				   struct upload_pack_data *data)
{}

void upload_pack(const int advertise_refs, const int stateless_rpc,
		 const int timeout)
{}

static int parse_want(struct packet_writer *writer, const char *line,
		      struct object_array *want_obj)
{}

static int parse_want_ref(struct packet_writer *writer, const char *line,
			  struct strmap *wanted_refs,
			  struct strvec *hidden_refs,
			  struct object_array *want_obj)
{}

static int parse_have(const char *line, struct upload_pack_data *data)
{}

static void trace2_fetch_info(struct upload_pack_data *data)
{}

static void process_args(struct packet_reader *request,
			 struct upload_pack_data *data)
{}

static int send_acks(struct upload_pack_data *data, struct object_array *acks)
{}

static int process_haves_and_send_acks(struct upload_pack_data *data)
{}

static void send_wanted_ref_info(struct upload_pack_data *data)
{}

static void send_shallow_info(struct upload_pack_data *data)
{}

enum fetch_state {};

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

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