I miss a high-level description of what the code is doing. Essentially, there's the complete repository list of refs, and you want to filter only some of them, right? From the name, I would guess that ref_filter is the structure describing how you are filtering, but from the code it seems to be the list you're filtering, not the filter.
Reading this again, A bit confused by what you're trying to imply. Could you rephrase please?
-- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html