git/builtin/update-ref.c

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "hash.h"
#include "refs.h"
#include "object-name.h"
#include "parse-options.h"
#include "quote.h"

static const char * const git_update_ref_usage[] =;

static char line_termination =;
static unsigned int update_flags;
static unsigned int default_flags;
static unsigned create_reflog_flag;
static const char *msg;

/*
 * Parse one whitespace- or NUL-terminated, possibly C-quoted argument
 * and append the result to arg.  Return a pointer to the terminator.
 * Die if there is an error in how the argument is C-quoted.  This
 * function is only used if not -z.
 */
static const char *parse_arg(const char *next, struct strbuf *arg)
{}

/*
 * Parse the reference name immediately after "command SP".  If not
 * -z, then handle C-quoting.  Return a pointer to a newly allocated
 * string containing the name of the reference, or NULL if there was
 * an error.  Update *next to point at the character that terminates
 * the argument.  Die if C-quoting is malformed or the reference name
 * is invalid.
 */
static char *parse_refname(const char **next)
{}

/*
 * Wrapper around parse_refname which skips the next delimiter.
 */
static char *parse_next_refname(const char **next)
{}

/*
 * Wrapper around parse_arg which skips the next delimiter.
 */
static char *parse_next_arg(const char **next)
{}

/*
 * The value being parsed is <old-oid> (as opposed to <new-oid>; the
 * difference affects which error messages are generated):
 */
#define PARSE_SHA1_OLD

/*
 * For backwards compatibility, accept an empty string for update's
 * <new-oid> in binary mode to be equivalent to specifying zeros.
 */
#define PARSE_SHA1_ALLOW_EMPTY

/*
 * Parse an argument separator followed by the next argument, if any.
 * If there is an argument, convert it to a SHA-1, write it to sha1,
 * set *next to point at the character terminating the argument, and
 * return 0.  If there is no argument at all (not even the empty
 * string), return 1 and leave *next unchanged.  If the value is
 * provided but cannot be converted to a SHA-1, die.  flags can
 * include PARSE_SHA1_OLD and/or PARSE_SHA1_ALLOW_EMPTY.
 */
static int parse_next_oid(const char **next, const char *end,
			  struct object_id *oid,
			  const char *command, const char *refname,
			  int flags)
{}


/*
 * The following five parse_cmd_*() functions parse the corresponding
 * command.  In each case, next points at the character following the
 * command name and the following space.  They each return a pointer
 * to the character terminating the command, and die with an
 * explanatory message if there are any parsing problems.  All of
 * these functions handle either text or binary format input,
 * depending on how line_termination is set.
 */

static void parse_cmd_update(struct ref_transaction *transaction,
			     const char *next, const char *end)
{}

static void parse_cmd_symref_update(struct ref_transaction *transaction,
				    const char *next, const char *end UNUSED)
{}

static void parse_cmd_create(struct ref_transaction *transaction,
			     const char *next, const char *end)
{}


static void parse_cmd_symref_create(struct ref_transaction *transaction,
				    const char *next, const char *end UNUSED)
{}

static void parse_cmd_delete(struct ref_transaction *transaction,
			     const char *next, const char *end)
{}


static void parse_cmd_symref_delete(struct ref_transaction *transaction,
				    const char *next, const char *end UNUSED)
{}


static void parse_cmd_verify(struct ref_transaction *transaction,
			     const char *next, const char *end)
{}

static void parse_cmd_symref_verify(struct ref_transaction *transaction,
				    const char *next, const char *end UNUSED)
{}

static void report_ok(const char *command)
{}

static void parse_cmd_option(struct ref_transaction *transaction UNUSED,
			     const char *next, const char *end UNUSED)
{}

static void parse_cmd_start(struct ref_transaction *transaction UNUSED,
			    const char *next, const char *end UNUSED)
{}

static void parse_cmd_prepare(struct ref_transaction *transaction,
			      const char *next, const char *end UNUSED)
{}

static void parse_cmd_abort(struct ref_transaction *transaction,
			    const char *next, const char *end UNUSED)
{}

static void parse_cmd_commit(struct ref_transaction *transaction,
			     const char *next, const char *end UNUSED)
{}

enum update_refs_state {};

static const struct parse_cmd {} command[] =;

static void update_refs_stdin(void)
{}

int cmd_update_ref(int argc,
		   const char **argv,
		   const char *prefix,
		   struct repository *repo UNUSED)
{}