If the repo the project is being stored in uses bitbucket cloud and it is checked out with an oauth token such as how jenkins does it the credentials string looks like a regex. This breaks a sanitizing function in GitScmProvider.
This change Pattern.quote()'s the http/https credentials when using them as the search string in String.replaceFirst. It also fixes the exception handler for the method so it actually shows the exception message instead of "{0}" when this error occurs.
Fix log to show actual error for bad url
If the repo the project is being stored in uses bitbucket cloud and it is checked out with an oauth token such as how jenkins does it the credentials string looks like a regex. This breaks a sanitizing function in GitScmProvider.
For example a url like: https://x-token-auth:{dKkmJHindwdsaw23-dsaHds5-_jjUBF3-S%c9f}@bitbucket.org/some-org/project.git
This change Pattern.quote()'s the http/https credentials when using them as the search string in String.replaceFirst. It also fixes the exception handler for the method so it actually shows the exception message instead of "{0}" when this error occurs. Fix log to show actual error for bad url