Skip to content

Add refname matching for mainBranches option#5310

Open
TommyAmberson wants to merge 3 commits intojesseduffield:masterfrom
TommyAmberson:ta/glob-main-branches
Open

Add refname matching for mainBranches option#5310
TommyAmberson wants to merge 3 commits intojesseduffield:masterfrom
TommyAmberson:ta/glob-main-branches

Conversation

@TommyAmberson
Copy link

@TommyAmberson TommyAmberson commented Feb 21, 2026

PR Description

Resolves #5246.

for-each-ref uses fnmatch to match branches. I decided to only check with for-each-ref when there are glob chars present (*?[) so that it won't effect performance for most people.

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • [ ] Text is internationalised (see here)
  • [ ] If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

Use `git for-each-ref` to resolve patterns containing *, ?, or [
against both local and origin remote branches.

Exact branch names continue to use `git rev-parse` for fast lookups.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow globbing in mainBranches

1 participant