Add exclude_patterns to ListRefs RPC
What does this MR do and why?
Contributes to gitlab#600332 (closed)
Problem
The ListRefs RPC does not support excluding specific
references from results. Callers that need a filtered
subset must fetch all matching refs and exclude unwanted
ones client-side, which breaks pagination correctness
when many refs are excluded.
Solution
Add a new exclude_patterns field to ListRefsRequest
that maps to --exclude=<pattern> flags on
git for-each-ref. This lets the caller exclude specific
ref patterns (exact or glob) server-side, so Gitaly returns
only the desired refs with correct pagination.
References
- Issue: gitlab#600332 (closed)
- Sibling MR (FindLocalBranches): !8810 (merged)
Screenshots or screen recordings
Not applicable (backend/proto change only).
How to set up and validate locally
- Check out this branch
- Run the tests:
go test ./internal/gitaly/service/ref/... -run "TestServer_ListRefs|TestListRefs_validate" -count=1 - All test cases should pass
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.