RefsFinder search doesn't support references with prefixes

Problem

The RefsFinder class doesn't support substring matching within reference names. It only matches references that start with the search term immediately after the prefix.

Current Behavior

The search pattern is constructed as:

pattern = [prefix, search, "*"].compact.join

This creates restrictive patterns like refs/heads/foo* that only match references starting with the search term.

Examples

  • Branch refs/heads/feature/foo - searching "foo" returns nothing because refs/heads/foo* doesn't match refs/heads/feature/foo
  • Branch refs/heads/feature - searching "e" returns nothing because refs/heads/e* doesn't match refs/heads/feature

Expected Behavior

Search should find references containing the search term anywhere within the reference name:

  • Searching "foo" should find refs/heads/feature/foo, refs/heads/foo-branch, refs/heads/my-foo-feature
  • Searching "e" should find refs/heads/feature, refs/heads/release, refs/heads/development

Proposed Solution

Modify pattern construction to support substring matching, such as refs/heads/*foo*.

Edited by Vasilii Iakliushin