Skip to content

Commit 92a23a3

Browse files
authored
fix: handle spaces in path (#155)
1 parent 46b1d95 commit 92a23a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/uri.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export function resolveURI(uri: string): { repo: string; rev: string; path: stri
66
const url = new URL(uri)
77
if (url.protocol === 'git:') {
88
return {
9-
repo: (url.host + url.pathname).replace(/^\/*/, '').toLowerCase(),
10-
rev: url.search.slice(1).toLowerCase(),
11-
path: url.hash.slice(1),
9+
repo: (url.host + decodeURIComponent(url.pathname)).replace(/^\/*/, ''),
10+
rev: decodeURIComponent(url.search.slice(1)),
11+
path: decodeURIComponent(url.hash.slice(1)),
1212
}
1313
}
1414
throw new Error(`unrecognized URI: ${JSON.stringify(uri)} (supported URI schemes: git)`)

0 commit comments

Comments
 (0)