diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-06-02 08:59:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-06-03 14:10:24 -0700 |
commit | d8e47e7d5c62e46c517cd56737f8fcb55ccf4c8f (patch) | |
tree | f526443cf3c44dbcf36048ad9f83190fc796528e /pathspec.c | |
parent | dd1a234eeb36eb853982ff3fe57b7c6752dd55c6 (diff) | |
download | git-sb/pathspec-label.tar.gz |
pathspec: disable preload-index when attribute pathspec magic is in usesb/pathspec-label
The recent addition of the pathspec magic that requires a path to
have certain attributes set is not yet compatible with the preload
index codepath (e.g. "git status ':(attr:VAR=VAL)'") because the
attribute subsystem is not thread-ready.
For now, disable preload-index when such a pathspec magic is in use,
until the attribute subsystem learns how to better cope with
threading, to ease the development of the parts of the system that
want to utilize the pathspec magic.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pathspec.c')
-rw-r--r-- | pathspec.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pathspec.c b/pathspec.c index 08e6c523e7..a32e379e6f 100644 --- a/pathspec.c +++ b/pathspec.c @@ -251,6 +251,18 @@ static void eat_long_magic(struct pathspec_item *item, const char *elt, *copyfrom_ = copyfrom; } +int pathspec_is_non_threadable(const struct pathspec *pathspec) +{ + int i; + + for (i = 0; i < pathspec->nr; i++) { + const struct pathspec_item *item = &pathspec->items[i]; + if (item->attr_check) + return 1; + } + return 0; +} + /* * Take an element of a pathspec and check for magic signatures. * Append the result to the prefix. Return the magic bitmap. |