]> git.ipfire.org Git - thirdparty/git.git/blobdiff - attr.c
attr: do not mark queried macros as unset
[thirdparty/git.git] / attr.c
diff --git a/attr.c b/attr.c
index 60d284796de728f59b839865eb035e1289a1a060..293755226cdb78fc48c3992213d2db188e9b96ed 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -1104,7 +1104,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;
 
@@ -1125,20 +1125,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);
 }