fix: url-encode repository directory segments and strip .git suffix (#2100)#2111
fix: url-encode repository directory segments and strip .git suffix (#2100)#2111munaibh wants to merge 1 commit intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughWalkthroughThis pull request addresses URL encoding for repository paths containing special characters. The useRepositoryUrl composable now URL-encodes individual directory path segments when constructing repository tree URLs. The normalizeGitUrl utility function additionally strips trailing .git suffixes during normalization. Corresponding unit tests verify the encoding behaviour for scoped packages and the .git suffix removal in various URL formats. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.Add a .trivyignore file to your project to customize which findings Trivy reports. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
🔗 Linked issue
Closes #2100
close #2097
🧭 Context
Scoped packages (e.g.
@tailwindcss/vite) were generating broken repository URLs due to two bugs in the URL construction flow. This incorporates the initial issue raised in the linked issue, but also the suggestion mentioned in the same thread here: #2100 (comment).📚 Description
The
.gitsuffix not stripped:normalizeGitUrlreturned URLs likehttps://github.com/tailwindlabs/tailwindcss.git, causing.gitto appear mid-URL when/tree/HEAD/<directory>was appended.@not url-encoded: values likepackages/@tailwindcss-vitewere appended as they were. The@was not encoded, but it should have been encoded as%40to produce a valid URL.