Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-06 01:26:16 +0300
committerJunio C Hamano <gitster@pobox.com>2019-02-06 01:26:16 +0300
commit02bf766cc5d7580ce17dfab36fce976bfd06585b (patch)
tree60753763bc256fb86c703721abca3d4596b0b4d0 /attr.c
parent11494daae7d6101cfb565b2a86b4dacefaeeedd8 (diff)
parent7b95849be42406b2e23bcdc4592d71d8724361ba (diff)
Merge branch 'jk/attr-macro-fix'
Asking "git check-attr" about a macro (e.g. "binary") on a specific path did not work correctly, even though "git check-attr -a" listed such a macro correctly. This has been corrected. * jk/attr-macro-fix: attr: do not mark queried macros as unset
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/attr.c b/attr.c
index b63fe0fc0e..0cba789129 100644
--- a/attr.c
+++ b/attr.c
@@ -1092,7 +1092,7 @@ static void collect_some_attrs(const struct index_state *istate,
const char *path,
struct attr_check *check)
{
- int i, pathlen, rem, dirlen;
+ int pathlen, rem, dirlen;
const char *cp, *last_slash = NULL;
int basename_offset;
@@ -1113,20 +1113,6 @@ static void collect_some_attrs(const struct index_state *istate,
all_attrs_init(&g_attr_hashmap, check);
determine_macros(check->all_attrs, check->stack);
- if (check->nr) {
- rem = 0;
- for (i = 0; i < check->nr; i++) {
- int n = check->items[i].attr->attr_nr;
- struct all_attrs_item *item = &check->all_attrs[n];
- if (item->macro) {
- item->value = ATTR__UNSET;
- rem++;
- }
- }
- if (rem == check->nr)
- return;
- }
-
rem = check->all_attrs_nr;
fill(path, pathlen, basename_offset, check->stack, check->all_attrs, rem);
}