Skip to content

Fix invalid regular expression in branch name special character check#972

Open
raymond-rebbeck wants to merge 2 commits into
intersystems:mainfrom
raymond-rebbeck:fix-regex-branch-name-special-chars
Open

Fix invalid regular expression in branch name special character check#972
raymond-rebbeck wants to merge 2 commits into
intersystems:mainfrom
raymond-rebbeck:fix-regex-branch-name-special-chars

Conversation

@raymond-rebbeck

@raymond-rebbeck raymond-rebbeck commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

Tried latest main branch on Studio and noticed there was an error when opening Git UI about invalid quantifier pointing at line 477 in git-webui.js - likely caused by the initial \* not being escaped and being treated as a regex operator.

After fixing this did not get any local branches listed in Studio or VS Code. After some investigating determined the following:

  • Backslash characters not correctly escaped.
  • webui.branchNamePattern.source starts and ends with ^ and $ respectively, which do not work when inserted into the middle of another regular expression so chop off the first and last characters to avoid this.

Testing

Tested locally on my own IRIS instance with several local branches. With VS Code and Studio.

Checklist

  • This branch has the latest changes from the main branch rebased or merged.
  • Web UI has been built (any changes in git-webui/src have matching changes in git-webui/release)
  • [N/A] CHANGELOG.md entry added if appropriate.
  • [N/A] Documentation has been/will be updated

Backslash characters not correctly escaped.

`webui.branchNamePattern.source` starts and ends with `^` and `$` respectively, which do not work when inserted into the middle of another regular expression so chop off the first and last characters to avoid this.
@raymond-rebbeck

Copy link
Copy Markdown
Contributor Author

Just updated this so that it will check if there is a '^' prefix or '$' suffix on the branch name regex before removing them, rather than just always blindly removing the first and last characters.

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.

1 participant