#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "date.h"
#include "dir.h"
#include "hex.h"
#include "object-store-ll.h"
#include "path.h"
#include "repository.h"
#include "object.h"
#include "attr.h"
#include "blob.h"
#include "tree.h"
#include "tree-walk.h"
#include "commit.h"
#include "tag.h"
#include "fsck.h"
#include "refs.h"
#include "url.h"
#include "utf8.h"
#include "oidset.h"
#include "packfile.h"
#include "submodule-config.h"
#include "config.h"
#include "help.h"
static ssize_t max_tree_entry_len = …;
#define STR …
#define MSG_ID …
static struct { … } msg_id_info[FSCK_MSG_MAX + 1] = …;
#undef MSG_ID
#undef STR
static void prepare_msg_ids(void)
{ … }
static int parse_msg_id(const char *text)
{ … }
void list_config_fsck_msg_ids(struct string_list *list, const char *prefix)
{ … }
static enum fsck_msg_type fsck_msg_type(enum fsck_msg_id msg_id,
struct fsck_options *options)
{ … }
static enum fsck_msg_type parse_msg_type(const char *str)
{ … }
int is_valid_msg_type(const char *msg_id, const char *msg_type)
{ … }
void fsck_set_msg_type_from_ids(struct fsck_options *options,
enum fsck_msg_id msg_id,
enum fsck_msg_type msg_type)
{ … }
void fsck_set_msg_type(struct fsck_options *options,
const char *msg_id_str, const char *msg_type_str)
{ … }
void fsck_set_msg_types(struct fsck_options *options, const char *values)
{ … }
static int object_on_skiplist(struct fsck_options *opts,
const struct object_id *oid)
{ … }
static int fsck_vreport(struct fsck_options *options,
void *fsck_report,
enum fsck_msg_id msg_id, const char *fmt, va_list ap)
{ … }
__attribute__((format (printf, 5, 6)))
static int report(struct fsck_options *options,
const struct object_id *oid, enum object_type object_type,
enum fsck_msg_id msg_id, const char *fmt, ...)
{ … }
int fsck_report_ref(struct fsck_options *options,
struct fsck_ref_report *report,
enum fsck_msg_id msg_id,
const char *fmt, ...)
{ … }
void fsck_enable_object_names(struct fsck_options *options)
{ … }
const char *fsck_get_object_name(struct fsck_options *options,
const struct object_id *oid)
{ … }
void fsck_put_object_name(struct fsck_options *options,
const struct object_id *oid,
const char *fmt, ...)
{ … }
const char *fsck_describe_object(struct fsck_options *options,
const struct object_id *oid)
{ … }
static int fsck_walk_tree(struct tree *tree, void *data, struct fsck_options *options)
{ … }
static int fsck_walk_commit(struct commit *commit, void *data, struct fsck_options *options)
{ … }
static int fsck_walk_tag(struct tag *tag, void *data, struct fsck_options *options)
{ … }
int fsck_walk(struct object *obj, void *data, struct fsck_options *options)
{ … }
struct name_stack { … };
static void name_stack_push(struct name_stack *stack, const char *name)
{ … }
static const char *name_stack_pop(struct name_stack *stack)
{ … }
static void name_stack_clear(struct name_stack *stack)
{ … }
#define TREE_UNORDERED …
#define TREE_HAS_DUPS …
static int is_less_than_slash(unsigned char c)
{ … }
static int verify_ordered(unsigned mode1, const char *name1,
unsigned mode2, const char *name2,
struct name_stack *candidates)
{ … }
static int fsck_tree(const struct object_id *tree_oid,
const char *buffer, unsigned long size,
struct fsck_options *options)
{ … }
static int verify_headers(const void *data, unsigned long size,
const struct object_id *oid, enum object_type type,
struct fsck_options *options)
{ … }
static int fsck_ident(const char **ident,
const struct object_id *oid, enum object_type type,
struct fsck_options *options)
{ … }
static int fsck_commit(const struct object_id *oid,
const char *buffer, unsigned long size,
struct fsck_options *options)
{ … }
static int fsck_tag(const struct object_id *oid, const char *buffer,
unsigned long size, struct fsck_options *options)
{ … }
int fsck_tag_standalone(const struct object_id *oid, const char *buffer,
unsigned long size, struct fsck_options *options,
struct object_id *tagged_oid,
int *tagged_type)
{ … }
struct fsck_gitmodules_data { … };
static int fsck_gitmodules_fn(const char *var, const char *value,
const struct config_context *ctx UNUSED,
void *vdata)
{ … }
static int fsck_blob(const struct object_id *oid, const char *buf,
unsigned long size, struct fsck_options *options)
{ … }
int fsck_object(struct object *obj, void *data, unsigned long size,
struct fsck_options *options)
{ … }
int fsck_buffer(const struct object_id *oid, enum object_type type,
const void *data, unsigned long size,
struct fsck_options *options)
{ … }
int fsck_objects_error_function(struct fsck_options *o,
void *fsck_report,
enum fsck_msg_type msg_type,
enum fsck_msg_id msg_id UNUSED,
const char *message)
{ … }
int fsck_refs_error_function(struct fsck_options *options UNUSED,
void *fsck_report,
enum fsck_msg_type msg_type,
enum fsck_msg_id msg_id UNUSED,
const char *message)
{ … }
static int fsck_blobs(struct oidset *blobs_found, struct oidset *blobs_done,
enum fsck_msg_id msg_missing, enum fsck_msg_id msg_type,
struct fsck_options *options, const char *blob_type)
{ … }
int fsck_finish(struct fsck_options *options)
{ … }
void fsck_options_clear(struct fsck_options *options)
{ … }
int git_fsck_config(const char *var, const char *value,
const struct config_context *ctx, void *cb)
{ … }
int fsck_objects_error_cb_print_missing_gitmodules(struct fsck_options *o,
void *fsck_report,
enum fsck_msg_type msg_type,
enum fsck_msg_id msg_id,
const char *message)
{ … }