Fix invalid regular expression in branch name special character check#972
Open
raymond-rebbeck wants to merge 2 commits into
Open
Fix invalid regular expression in branch name special character check#972raymond-rebbeck wants to merge 2 commits into
raymond-rebbeck wants to merge 2 commits into
Conversation
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.
…uffix before removing them
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
webui.branchNamePattern.sourcestarts 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
mainbranch rebased or merged.git-webui/srchave matching changes ingit-webui/release)