Merge branch 'bw/attr'
The gitattributes machinery is being taught to work better in a multi-threaded environment. * bw/attr: (27 commits) attr: reformat git_attr_set_direction() function attr: push the bare repo check into read_attr() attr: store attribute stack in attr_check structure attr: tighten const correctness with git_attr and match_attr attr: remove maybe-real, maybe-macro from git_attr attr: eliminate global check_all_attr array attr: use hashmap for attribute dictionary attr: change validity check for attribute names to use positive logic attr: pass struct attr_check to collect_some_attrs attr: retire git_check_attrs() API attr: convert git_check_attrs() callers to use the new API attr: convert git_all_attrs() to use "struct attr_check" attr: (re)introduce git_check_attr() and struct attr_check attr: rename function and struct related to checking attributes attr.c: outline the future plans by heavily commenting Documentation: fix a typo attr.c: add push_stack() helper attr: support quoting pathname patterns in C style attr.c: plug small leak in parse_attr_line() attr.c: tighten constness around "git_attr" structure ...
This commit is contained in:
@ -894,24 +894,15 @@ static void write_pack_file(void)
|
||||
written, nr_result);
|
||||
}
|
||||
|
||||
static void setup_delta_attr_check(struct git_attr_check *check)
|
||||
{
|
||||
static struct git_attr *attr_delta;
|
||||
|
||||
if (!attr_delta)
|
||||
attr_delta = git_attr("delta");
|
||||
|
||||
check[0].attr = attr_delta;
|
||||
}
|
||||
|
||||
static int no_try_delta(const char *path)
|
||||
{
|
||||
struct git_attr_check check[1];
|
||||
static struct attr_check *check;
|
||||
|
||||
setup_delta_attr_check(check);
|
||||
if (git_check_attr(path, ARRAY_SIZE(check), check))
|
||||
if (!check)
|
||||
check = attr_check_initl("delta", NULL);
|
||||
if (git_check_attr(path, check))
|
||||
return 0;
|
||||
if (ATTR_FALSE(check->value))
|
||||
if (ATTR_FALSE(check->items[0].value))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user