feat(gitclone): support Codeberg URLs and ssh:// protocol format#2
Open
drewr wants to merge 1 commit into
Open
feat(gitclone): support Codeberg URLs and ssh:// protocol format#2drewr wants to merge 1 commit into
drewr wants to merge 1 commit into
Conversation
Add support for Codeberg host URLs (ssh:// and https://) and the ssh:// protocol URL format (e.g. ssh://git@codeberg.org/ziglang/zig.git). Previously only SCP-style SSH (git@host:path) and HTTP(S) protocols were supported. The ssh:// protocol handler is checked before the SCP-style SSH handler to avoid conflicts with URLs containing '@'. Also fix a crash in the SCP-style SSH handler when colon_pos is missing — use 'orelse' instead of '.?' for safe null handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for Codeberg host URLs and the
ssh://protocol URL format.Supported formats (new)
ssh://git@codeberg.org/ziglang/zig.git— SSH protocol URLhttps://codeberg.org/ziglang/zig.git— HTTPS (already worked, now tested)Changes
src/gitclone.zig— Newssh://protocol handler; reorders handlers sossh://is checked before SCP-style SSH (git@host:path) to avoid conflicts with URLs containing@. Fixes a crash in SCP-style SSH handler whencolon_posis missing (usesorelseinstead of.?).src/gitclone_test.zig— 6 new tests covering Codeberg URLs,ssh://protocol parsing, and invalidssh://URLs.Testing
All existing tests pass; new tests cover both valid and invalid URL cases.