unjs / giget

✨ Download templates and git repositories with pleasure!
MIT License
446 stars 37 forks source link

git refs that include slashes do not get parsed correctly #101

Closed nick-genesis closed 11 months ago

nick-genesis commented 1 year ago

Environment

Shouldn't make a difference, tested with Node v18.15.0

Reproduction

Attempt a download of any git branch that includes slashes.

Describe the bug

The ref capturing group of inputRegex used by parseGitURI is too strict, does not include /. This can result in failed download attempts.

This might not technically be a bug, but there's no downside to adjusting the regex to allow slashes afaik.

It would be nice to get this working as org/repo#user/ABC-123 is a pretty common pattern.

Additional context

I have adjusted the regex and added a test for it, only opening this issue to reference it in the PR.

Resolved by https://github.com/unjs/giget/pull/102

Logs

No response