/* The argument to filter_refs */
struct ref_filter {
const char *pattern;
+ const char *prefix;
each_ref_fn *fn;
void *cb_data;
};
if (wildmatch(filter->pattern, refname, 0))
return 0;
+ if (filter->prefix)
+ skip_prefix(refname, filter->prefix, &refname);
return filter->fn(refname, oid, flags, filter->cb_data);
}
}
filter.pattern = real_pattern.buf;
+ filter.prefix = prefix;
filter.fn = fn;
filter.cb_data = cb_data;
ret = for_each_ref(filter_refs, &filter);