Skip to content

fix(extensions): avoid duplicate .git suffix in GitHub shorthand - #4524

Open
onatozmenn wants to merge 1 commit into
OpenHands:mainfrom
onatozmenn:fix/github-shorthand-git-suffix
Open

fix(extensions): avoid duplicate .git suffix in GitHub shorthand#4524
onatozmenn wants to merge 1 commit into
OpenHands:mainfrom
onatozmenn:fix/github-shorthand-git-suffix

Conversation

@onatozmenn

@onatozmenn onatozmenn commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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.git currently becomes https://github.com/owner/repo.git.git, so extension fetching tries the wrong clone URL.

Summary

  • Pass the expanded GitHub shorthand through normalize_git_url instead of appending .git directly.
  • Cover an already-suffixed shorthand while keeping the existing shorthand and full URL behavior unchanged.

Issue Number

Fixes #4520

How to Test

Invoked the parser directly with this checkout on PYTHONPATH:

main:   https://github.com/owner/repo.git.git
branch: https://github.com/owner/repo.git

Then ran:

python -m pytest tests/sdk/extensions/test_fetch.py -q
42 passed

Ruff format, Ruff lint, pycodestyle, import rules, tool registration, and git diff --check also pass for the changed files.

Video/Screenshots

Not applicable for this parser-only change.

Design Doc

Not needed for this small bug fix.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

The existing shorthand format checks are unchanged.

Signed-off-by: onatozmenn <onatozmen44@gmail.com>
@onatozmenn
onatozmenn marked this pull request as ready for review August 18, 2026 09:09
@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: 3a138c5566a340ddc1a1425d3ae0c369845c920f
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/970f827e-66cb-46f5-80bc-7a7585a8b70f

This comment was posted by an AI agent (OpenHands).

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

[Bug]: parse_extension_source duplicates an existing .git suffix in GitHub shorthand

2 participants