Skip to content

Commit d482049

Browse files
author
TheSnoozer
authored
Merge pull request #306 from TheSnoozer/master
#305: URISyntaxException with remote path pointing to windows directory (e.g. file:///C:\Users\test\example)
2 parents 33563b7 + a4d52d6 commit d482049

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/main/java/pl/project13/maven/git/GitDataProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ protected void put(@NotNull Properties properties, String key, String value) {
221221
/**
222222
* Regex to check for SCP-style SSH+GIT connection strings such as 'git@github.com'
223223
*/
224-
static final Pattern GIT_SCP_FORMAT = Pattern.compile("^([a-zA-Z0-9_.+-])+@(.*)|^\\[([^\\]])+\\]:(.*)");
224+
static final Pattern GIT_SCP_FORMAT = Pattern.compile("^([a-zA-Z0-9_.+-])+@(.*)|^\\[([^\\]])+\\]:(.*)|^file:///(.*)");
225225
/**
226226
* If the git remote value is a URI and contains a user info component, strip the password from it if it exists.
227227
*

src/test/java/pl/project13/maven/git/UriUserInfoRemoverTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public static Collection<Object[]> parameters() {
4646
{ "ssh://git@github.com/", "ssh://git@github.com/" },
4747
{ "/path/to/repo.git/", "/path/to/repo.git/" },
4848
{ "file:///path/to/repo.git/", "file:///path/to/repo.git/"},
49+
{ "file:///C:\\Users\\test\\example", "file:///C:\\Users\\test\\example"},
4950
};
5051
return Arrays.asList(data);
5152
}

0 commit comments

Comments
 (0)