slachiewicz commented on code in PR #1438:
URL: https://github.com/apache/maven-scm/pull/1438#discussion_r4648661219


##########
maven-scm-providers/maven-scm-providers-git/maven-scm-provider-git-commons/src/main/java/org/apache/maven/scm/provider/git/repository/GitScmProviderRepository.java:
##########
@@ -346,8 +346,10 @@ private String parseUserInfo(RepositoryUrl repoUrl, String 
url) throws ScmExcept
             return url;
         }
         // extract user information, broken see SCM-907
-        int indexAt = url.lastIndexOf('@');
-        if (indexAt >= 0) {
+        // user info is only part of the authority, which ends at the first 
slash

Review Comment:
   I kept the string parse. `java.net.URI` and `java.net.URL` cannot take over 
for every form this class accepts: `URI` throws on scp-style 
`[email protected]:olamy/x.git` and on `C:\…` paths, and returns no user info or 
host for 
`http://[email protected]:[email protected]:8800/pmgt/trunk` (an 
existing test expects the user `[email protected]`); `URL` rejects `ssh://` and 
`git://`. The first-slash bound is the authority rule from RFC 3986 that #1138 
asks for. I added tests for the scp-style 
`[email protected]:olamy/workspace@2/repo.git` and for a local 
`/home/jenkins/workspace@2/repo`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to