git/http-push.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "environment.h"
#include "hex.h"
#include "repository.h"
#include "commit.h"
#include "tag.h"
#include "blob.h"
#include "http.h"
#include "diff.h"
#include "revision.h"
#include "remote.h"
#include "list-objects.h"
#include "setup.h"
#include "sigchain.h"
#include "strvec.h"
#include "tree.h"
#include "tree-walk.h"
#include "url.h"
#include "packfile.h"
#include "object-store-ll.h"
#include "commit-reach.h"

#ifdef EXPAT_NEEDS_XMLPARSE_H
#include <xmlparse.h>
#else
#include <expat.h>
#endif

static const char http_push_usage[] =;

#ifndef XML_STATUS_OK
enum XML_Status {};
#define XML_STATUS_OK
#define XML_STATUS_ERROR
#endif

#define PREV_BUF_SIZE

/* DAV methods */
#define DAV_LOCK
#define DAV_MKCOL
#define DAV_MOVE
#define DAV_PROPFIND
#define DAV_PUT
#define DAV_UNLOCK
#define DAV_DELETE

/* DAV lock flags */
#define DAV_PROP_LOCKWR
#define DAV_PROP_LOCKEX
#define DAV_LOCK_OK

/* DAV XML properties */
#define DAV_CTX_LOCKENTRY
#define DAV_CTX_LOCKTYPE_WRITE
#define DAV_CTX_LOCKTYPE_EXCLUSIVE
#define DAV_ACTIVELOCK_OWNER
#define DAV_ACTIVELOCK_TIMEOUT
#define DAV_ACTIVELOCK_TOKEN
#define DAV_PROPFIND_RESP
#define DAV_PROPFIND_NAME
#define DAV_PROPFIND_COLLECTION

/* DAV request body templates */
#define PROPFIND_SUPPORTEDLOCK_REQUEST
#define PROPFIND_ALL_REQUEST
#define LOCK_REQUEST

#define LOCK_TIME
#define LOCK_REFRESH

/* Remember to update object flag allocation in object.h */
#define LOCAL
#define REMOTE
#define FETCHING
#define PUSHING

/* We allow "recursive" symbolic refs. Only within reason, though */
#define MAXDEPTH

static int pushing;
static int aborted;
static signed char remote_dir_exists[256];

static int push_verbosely;
static int push_all =;
static int force_all;
static int dry_run;
static int helper_status;

static struct object_list *objects;

struct repo {};

static struct repo *repo;

enum transfer_state {};

struct transfer_request {};

static struct transfer_request *request_queue_head;

struct xml_ctx {};

struct remote_lock {};

/* Flags that control remote_ls processing */
#define PROCESS_FILES
#define PROCESS_DIRS
#define RECURSIVE

/* Flags that remote_ls passes to callback functions */
#define IS_DIR

struct remote_ls_ctx {};

/* get_dav_token_headers options */
enum dav_header_flag {};

static char *xml_entities(const char *s)
{}

static void curl_setup_http_get(CURL *curl, const char *url,
		const char *custom_req)
{}

static void curl_setup_http(CURL *curl, const char *url,
		const char *custom_req, struct buffer *buffer,
		curl_write_callback write_fn)
{}

static struct curl_slist *get_dav_token_headers(struct remote_lock *lock, enum dav_header_flag options)
{}

static void finish_request(struct transfer_request *request);
static void release_request(struct transfer_request *request);

static void process_response(void *callback_data)
{}

static void start_fetch_loose(struct transfer_request *request)
{}

static void start_mkcol(struct transfer_request *request)
{}

static void start_fetch_packed(struct transfer_request *request)
{}

static void start_put(struct transfer_request *request)
{}

static void start_move(struct transfer_request *request)
{}

static int refresh_lock(struct remote_lock *lock)
{}

static void check_locks(void)
{}

static void release_request(struct transfer_request *request)
{}

static void finish_request(struct transfer_request *request)
{}

static int is_running_queue;
static int fill_active_slot(void *data UNUSED)
{}

static void get_remote_object_list(unsigned char parent);

static void add_fetch_request(struct object *obj)
{}

static int add_send_request(struct object *obj, struct remote_lock *lock)
{}

static int fetch_indices(void)
{}

static void one_remote_object(const struct object_id *oid)
{}

static void handle_lockprop_ctx(struct xml_ctx *ctx, int tag_closed)
{}

static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed)
{}

static void one_remote_ref(const char *refname);

static void
xml_start_tag(void *userData, const char *name, const char **atts UNUSED)
{}

static void
xml_end_tag(void *userData, const char *name)
{}

static void
xml_cdata(void *userData, const XML_Char *s, int len)
{}

static struct remote_lock *lock_remote(const char *path, long timeout)
{}

static int unlock_remote(struct remote_lock *lock)
{}

static void remove_locks(void)
{}

static void remove_locks_on_signal(int signo)
{}

static void remote_ls(const char *path, int flags,
		      void (*userFunc)(struct remote_ls_ctx *ls),
		      void *userData);

/* extract hex from sharded "xx/x{38}" filename */
static int get_oid_hex_from_objpath(const char *path, struct object_id *oid)
{}

static void process_ls_object(struct remote_ls_ctx *ls)
{}

static void process_ls_ref(struct remote_ls_ctx *ls)
{}

static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed)
{}

/*
 * NEEDSWORK: remote_ls() ignores info/refs on the remote side.  But it
 * should _only_ heed the information from that file, instead of trying to
 * determine the refs from the remote file system (badly: it does not even
 * know about packed-refs).
 */
static void remote_ls(const char *path, int flags,
		      void (*userFunc)(struct remote_ls_ctx *ls),
		      void *userData)
{}

static void get_remote_object_list(unsigned char parent)
{}

static int locking_available(void)
{}

static struct object_list **add_one_object(struct object *obj, struct object_list **p)
{}

static struct object_list **process_blob(struct blob *blob,
					 struct object_list **p)
{}

static struct object_list **process_tree(struct tree *tree,
					 struct object_list **p)
{}

static int get_delta(struct rev_info *revs, struct remote_lock *lock)
{}

static int update_remote(const struct object_id *oid, struct remote_lock *lock)
{}

static struct ref *remote_refs;

static void one_remote_ref(const char *refname)
{}

static void get_dav_remote_heads(void)
{}

static void add_remote_info_ref(struct remote_ls_ctx *ls)
{}

static void update_remote_info_refs(struct remote_lock *lock)
{}

static int remote_exists(const char *path)
{}

static void fetch_symref(const char *path, char **symref, struct object_id *oid)
{}

static int verify_merge_base(struct object_id *head_oid, struct ref *remote)
{}

static int delete_remote_branch(const char *pattern, int force)
{}

static void run_request_queue(void)
{}

int cmd_main(int argc, const char **argv)
{}