Skip to content

feat(gitclone): support Codeberg URLs and ssh:// protocol format#2

Open
drewr wants to merge 1 commit into
mainfrom
feat/codeberg-ssh-url-support
Open

feat(gitclone): support Codeberg URLs and ssh:// protocol format#2
drewr wants to merge 1 commit into
mainfrom
feat/codeberg-ssh-url-support

Conversation

@drewr
Copy link
Copy Markdown
Owner

@drewr drewr commented Jun 1, 2026

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 URL
  • https://codeberg.org/ziglang/zig.git — HTTPS (already worked, now tested)

Changes

  • src/gitclone.zig — New ssh:// protocol handler; reorders handlers so ssh:// is checked before SCP-style SSH (git@host:path) to avoid conflicts with URLs containing @. Fixes a crash in SCP-style SSH handler when colon_pos is missing (uses orelse instead of .?).
  • src/gitclone_test.zig — 6 new tests covering Codeberg URLs, ssh:// protocol parsing, and invalid ssh:// URLs.

Testing

All existing tests pass; new tests cover both valid and invalid URL cases.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant