travis-ci: check that all build artifacts are .gitignore-d
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index 88658ba76960401e4ab246b597d1212f5b435de1..ea2b9f84f8d3fab5452105f10f4492d672cd1d90 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -230,7 +230,7 @@ static int filter_refs(const char *refname, const struct object_id *oid,
 {
        struct ref_filter *filter = (struct ref_filter *)data;
 
-       if (wildmatch(filter->pattern, refname, 0, NULL))
+       if (wildmatch(filter->pattern, refname, 0))
                return 0;
        return filter->fn(refname, oid, flags, filter->cb_data);
 }
@@ -1160,7 +1160,7 @@ int ref_is_hidden(const char *refname, const char *refname_full)
                const char *match = hide_refs->items[i].string;
                const char *subject;
                int neg = 0;
-               int len;
+               const char *p;
 
                if (*match == '!') {
                        neg = 1;
@@ -1175,10 +1175,9 @@ int ref_is_hidden(const char *refname, const char *refname_full)
                }
 
                /* refname can be NULL when namespaces are used. */
-               if (!subject || !starts_with(subject, match))
-                       continue;
-               len = strlen(match);
-               if (!subject[len] || subject[len] == '/')
+               if (subject &&
+                   skip_prefix(subject, match, &p) &&
+                   (!*p || *p == '/'))
                        return !neg;
        }
        return 0;
@@ -1525,7 +1524,8 @@ struct ref_store_hash_entry
        char name[FLEX_ARRAY];
 };
 
-static int ref_store_hash_cmp(const void *entry, const void *entry_or_key,
+static int ref_store_hash_cmp(const void *unused_cmp_data,
+                             const void *entry, const void *entry_or_key,
                              const void *keydata)
 {
        const struct ref_store_hash_entry *e1 = entry, *e2 = entry_or_key;
@@ -1608,7 +1608,7 @@ static void register_ref_store_map(struct hashmap *map,
                                   const char *name)
 {
        if (!map->tablesize)
-               hashmap_init(map, ref_store_hash_cmp, 0);
+               hashmap_init(map, ref_store_hash_cmp, NULL, 0);
 
        if (hashmap_put(map, alloc_ref_store_hash_entry(name, refs)))
                die("BUG: %s ref_store '%s' initialized twice", type, name);