diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-02-27 21:57:14 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-27 21:57:14 (GMT) |
commit | a04855bae8d75d22b0c909c7d1febedcd05ba9b1 (patch) | |
tree | b6f96ab383fc925c7a4abb9b62076ffbe7382269 /builtin/pack-objects.c | |
parent | fdeb89fdeb1db8f8910bc33547dd819065bc4e9d (diff) | |
parent | f0dd042148233ad4681b29f35f3bc3ba3b962474 (diff) | |
download | git-a04855bae8d75d22b0c909c7d1febedcd05ba9b1.zip git-a04855bae8d75d22b0c909c7d1febedcd05ba9b1.tar.gz git-a04855bae8d75d22b0c909c7d1febedcd05ba9b1.tar.bz2 |
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
...
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r-- | builtin/pack-objects.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index c7af475..f294dcf 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -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; } |