fix(extensions): avoid duplicate .git suffix in GitHub shorthand - #4524
fix(extensions): avoid duplicate .git suffix in GitHub shorthand#4524onatozmenn wants to merge 1 commit into
Conversation
Signed-off-by: onatozmenn <onatozmen44@gmail.com>
|
🤖 OpenHands is reviewing this PR. Head commit: This comment was posted by an AI agent (OpenHands). |
all-hands-bot
left a comment
There was a problem hiding this comment.
This review was created by an AI agent (OpenHands) on behalf of the repository maintainers.
Summary
This is a clean, minimal bug fix. Routing the GitHub shorthand expansion through normalize_git_url (instead of unconditionally appending .git) correctly resolves the duplicate-suffix case (github:owner/repo.git -> https://github.com/owner/repo.git.git) while preserving the existing behavior for the bare shorthand (github:owner/repo -> https://github.com/owner/repo.git).
normalize_git_url already guards against re-adding .git when the URL ends with it, and only applies to https:///http:// URLs, so the fix is safe and idiomatic — it reuses the same normalization path already used for full git URLs a few lines below.
Findings
No material issues found. The new test covers the fixed case, and existing shorthand/full-URL behavior is unchanged.
Risk Assessment
Low. Parser-only change with no security, persistence, or API-surface impact. The behavior change is strictly a bug fix on an edge case.
HUMAN:
I fixed the GitHub shorthand parsing so URLs that already end in .git no longer get an extra .git appended.
AGENT:
Why
github:owner/repo.gitcurrently becomeshttps://github.com/owner/repo.git.git, so extension fetching tries the wrong clone URL.Summary
normalize_git_urlinstead of appending.gitdirectly.Issue Number
Fixes #4520
How to Test
Invoked the parser directly with this checkout on
PYTHONPATH:Then ran:
Ruff format, Ruff lint, pycodestyle, import rules, tool registration, and
git diff --checkalso pass for the changed files.Video/Screenshots
Not applicable for this parser-only change.
Design Doc
Not needed for this small bug fix.
Type
Notes
The existing shorthand format checks are unchanged.