#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
#include "exec-cmd.h"
#include "attr.h"
#include "dir.h"
#include "gettext.h"
#include "path.h"
#include "utf8.h"
#include "quote.h"
#include "read-cache-ll.h"
#include "refs.h"
#include "revision.h"
#include "object-store-ll.h"
#include "setup.h"
#include "thread-utils.h"
#include "tree-walk.h"
#include "object-name.h"
char *git_attr_tree;
const char git_attr__true[] = …;
const char git_attr__false[] = …;
static const char git_attr__unknown[] = …;
#define ATTR__TRUE …
#define ATTR__FALSE …
#define ATTR__UNSET …
#define ATTR__UNKNOWN …
struct git_attr { … };
const char *git_attr_name(const struct git_attr *attr)
{ … }
struct attr_hashmap { … };
static inline void hashmap_lock(struct attr_hashmap *map)
{ … }
static inline void hashmap_unlock(struct attr_hashmap *map)
{ … }
struct attr_hash_entry { … };
static int attr_hash_entry_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata UNUSED)
{ … }
static struct attr_hashmap g_attr_hashmap = …;
static void *attr_hashmap_get(struct attr_hashmap *map,
const char *key, size_t keylen)
{ … }
static void attr_hashmap_add(struct attr_hashmap *map,
const char *key, size_t keylen,
void *value)
{ … }
struct all_attrs_item { … };
static void all_attrs_init(struct attr_hashmap *map, struct attr_check *check)
{ … }
static int attr_name_reserved(const char *name)
{ … }
static int attr_name_valid(const char *name, size_t namelen)
{ … }
static void report_invalid_attr(const char *name, size_t len,
const char *src, int lineno)
{ … }
static const struct git_attr *git_attr_internal(const char *name, size_t namelen)
{ … }
const struct git_attr *git_attr(const char *name)
{ … }
struct attr_state { … };
struct pattern { … };
struct match_attr { … };
static const char blank[] = …;
#define READ_ATTR_MACRO_OK …
#define READ_ATTR_NOFOLLOW …
static const char *parse_attr(const char *src, int lineno, const char *cp,
struct attr_state *e)
{ … }
static struct match_attr *parse_attr_line(const char *line, const char *src,
int lineno, unsigned flags)
{ … }
struct attr_stack { … };
static void attr_stack_free(struct attr_stack *e)
{ … }
static void drop_attr_stack(struct attr_stack **stack)
{ … }
static struct check_vector { … } check_vector;
static inline void vector_lock(void)
{ … }
static inline void vector_unlock(void)
{ … }
static void check_vector_add(struct attr_check *c)
{ … }
static void check_vector_remove(struct attr_check *check)
{ … }
static void drop_all_attr_stacks(void)
{ … }
struct attr_check *attr_check_alloc(void)
{ … }
struct attr_check *attr_check_initl(const char *one, ...)
{ … }
struct attr_check *attr_check_dup(const struct attr_check *check)
{ … }
struct attr_check_item *attr_check_append(struct attr_check *check,
const struct git_attr *attr)
{ … }
void attr_check_reset(struct attr_check *check)
{ … }
void attr_check_clear(struct attr_check *check)
{ … }
void attr_check_free(struct attr_check *check)
{ … }
static const char *builtin_attr[] = …;
static void handle_attr_line(struct attr_stack *res,
const char *line,
const char *src,
int lineno,
unsigned flags)
{ … }
static struct attr_stack *read_attr_from_array(const char **list)
{ … }
static enum git_attr_direction direction;
void git_attr_set_direction(enum git_attr_direction new_direction)
{ … }
static struct attr_stack *read_attr_from_file(const char *path, unsigned flags)
{ … }
static struct attr_stack *read_attr_from_buf(char *buf, size_t length,
const char *path, unsigned flags)
{ … }
static struct attr_stack *read_attr_from_blob(struct index_state *istate,
const struct object_id *tree_oid,
const char *path, unsigned flags)
{ … }
static struct attr_stack *read_attr_from_index(struct index_state *istate,
const char *path, unsigned flags)
{ … }
static struct attr_stack *read_attr(struct index_state *istate,
const struct object_id *tree_oid,
const char *path, unsigned flags)
{ … }
const char *git_attr_system_file(void)
{ … }
const char *git_attr_global_file(void)
{ … }
int git_attr_system_is_enabled(void)
{ … }
static GIT_PATH_FUNC(git_path_info_attributes, INFOATTRIBUTES_FILE)
static void push_stack(struct attr_stack **attr_stack_p,
struct attr_stack *elem, char *origin, size_t originlen)
{ … }
static void bootstrap_attr_stack(struct index_state *istate,
const struct object_id *tree_oid,
struct attr_stack **stack)
{ … }
static void prepare_attr_stack(struct index_state *istate,
const struct object_id *tree_oid,
const char *path, int dirlen,
struct attr_stack **stack)
{ … }
static int path_matches(const char *pathname, int pathlen,
int basename_offset,
const struct pattern *pat,
const char *base, int baselen)
{ … }
static int macroexpand_one(struct all_attrs_item *all_attrs, int nr, int rem);
static int fill_one(struct all_attrs_item *all_attrs,
const struct match_attr *a, int rem)
{ … }
static int fill(const char *path, int pathlen, int basename_offset,
const struct attr_stack *stack,
struct all_attrs_item *all_attrs, int rem)
{ … }
static int macroexpand_one(struct all_attrs_item *all_attrs, int nr, int rem)
{ … }
static void determine_macros(struct all_attrs_item *all_attrs,
const struct attr_stack *stack)
{ … }
static void collect_some_attrs(struct index_state *istate,
const struct object_id *tree_oid,
const char *path, struct attr_check *check)
{ … }
static const char *default_attr_source_tree_object_name;
void set_git_attr_source(const char *tree_object_name)
{ … }
static int compute_default_attr_source(struct object_id *attr_source)
{ … }
static struct object_id *default_attr_source(void)
{ … }
static const char *interned_mode_string(unsigned int mode)
{ … }
static const char *builtin_object_mode_attr(struct index_state *istate, const char *path)
{ … }
static const char *compute_builtin_attr(struct index_state *istate,
const char *path,
const struct git_attr *attr) { … }
void git_check_attr(struct index_state *istate,
const char *path,
struct attr_check *check)
{ … }
void git_all_attrs(struct index_state *istate,
const char *path, struct attr_check *check)
{ … }
void attr_start(void)
{ … }