Merge branch 'rs/qsort-s' into maint
[gitweb.git] / builtin / describe.c
index 89ea1cdd60a215473ecb52ff2a4ce51932e1cf6d..94ff2fba0b024dd351d65f11510cb07070084d4d 100644 (file)
@@ -155,18 +155,21 @@ static int get_name(const char *path, const struct object_id *oid, int flag, voi
         * pattern.
         */
        if (patterns.nr) {
+               int found = 0;
                struct string_list_item *item;
 
                if (!is_tag)
                        return 0;
 
                for_each_string_list_item(item, &patterns) {
-                       if (!wildmatch(item->string, path + 10, 0))
+                       if (!wildmatch(item->string, path + 10, 0)) {
+                               found = 1;
                                break;
+                       }
+               }
 
-                       /* If we get here, no pattern matched. */
+               if (!found)
                        return 0;
-               }
        }
 
        /* Is it annotated? */