We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d8fcf5 commit dbfb68dCopy full SHA for dbfb68d
1 file changed
app/composables/useRepositoryUrl.ts
@@ -1,4 +1,4 @@
1
-import { joinURL } from 'ufo'
+import { joinURL, withoutTrailingSlash } from 'ufo'
2
3
type RequestedVersion = SlimPackument['requestedVersion'] | null
4
@@ -21,9 +21,11 @@ export function useRepositoryUrl(
21
return null
22
}
23
24
- // append `repository.directory` for monorepo packages
+ // Fix: Strip trailing .git (and any leftovers) before constructing the directory link
25
+ url = url.replace(/\.git\/?$/, '')
26
+
27
if (repo.directory) {
- url = joinURL(`${url}/tree/HEAD`, repo.directory)
28
+ url = joinURL(`${withoutTrailingSlash(url)}/tree/HEAD`, repo.directory)
29
30
31
return url
0 commit comments