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

Screenshots or screen recordings

Not applicable (backend/proto change only).

How to set up and validate locally

  1. Check out this branch
  2. Run the tests:
    go test ./internal/gitaly/service/ref/... -run "TestServer_ListRefs|TestListRefs_validate" -count=1
  3. 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.

Merge request reports

Loading
Loading