Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openhands-sdk/openhands/sdk/extensions/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def parse_extension_source(source: str) -> tuple[SourceType, str]:
f"Invalid GitHub shorthand format: {source}. "
f"Expected format: github:owner/repo"
)
url = f"https://github.com/{repo_path}.git"
url = normalize_git_url(f"https://github.com/{repo_path}")
return (SourceType.GITHUB, url)

# Git URLs: detect by protocol/scheme rather than enumerating providers
Expand Down
6 changes: 6 additions & 0 deletions tests/sdk/extensions/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ def test_parse_github_shorthand():
assert url == "https://github.com/owner/repo.git"


def test_parse_github_shorthand_with_git_suffix():
source_type, url = parse_extension_source("github:owner/repo.git")
assert source_type == SourceType.GITHUB
assert url == "https://github.com/owner/repo.git"


def test_parse_github_shorthand_with_whitespace():
source_type, url = parse_extension_source(" github:owner/repo ")
assert source_type == SourceType.GITHUB
Expand Down
Loading