fix: support ssh:// protocol URLs and detect unreplaced template variables - #7
Merged
Conversation
RepoInfo::from_url() only handled SCP-like (git@host:path) and
HTTPS URLs, causing ssh:// protocol URLs like
ssh://git@github.com/owner/repo.git to return None.
This left template variables ({host}, {owner}, {repository})
unreplaced, creating literal directory names.
Change generate_worktree_name() to return Result and error when
template variables like {host}, {owner}, {repository} remain
unreplaced after substitution. This prevents silent creation of
literal directory names when repo info is unavailable.
tosaka07
marked this pull request as ready for review
February 13, 2026 03:58
- bytes 1.11.0 -> 1.11.1 (RUSTSEC-2026-0007: integer overflow) - time 0.3.46 -> 0.3.47 (RUSTSEC-2026-0009: stack exhaustion DoS) - git2 0.20.3 -> 0.20.4 (RUSTSEC-2026-0008: undefined behavior)
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
RepoInfo::from_url()がssh://およびgit://プロトコル URL をパースできるよう修正。ssh://git@github.com/owner/repo.gitのような URL で{host},{owner},{repository}テンプレート変数が未置換のままディレクトリ名になっていた問題を解消generate_worktree_name()をResult返却に変更し、テンプレート変数が未置換のまま残った場合にエラーメッセージを表示する安全策を追加Test plan
cargo clippy -- -D warningspasscargo testpass (226 tests)ssh://git@host/owner/repo.git形式の URL パーステスト追加ssh://host:port/owner/repo.gitポート付き URL テスト追加git://host/owner/repo.gitgit プロトコル URL テスト追加file://や空文字列等のエッジケーステスト追加