prefer push URL when detecting remote, cope with SSH forms #27

Merged
heiko merged 3 commits from fix/26-ssh-git-repo-urls into master 2026-05-18 19:37:17 +02:00
Owner

Fixes #26.

Summary

  • Detect() now tries git remote get-url --push first; falls back to
    the fetch URL if the push URL can't be parsed
  • When no explicit push URL is configured, --push returns the fetch
    URL, so the common case is unaffected
  • Added test rows for ssh:// and SCP-style URLs without .git suffix

Notes

API-time retry (if the derived HTTPS endpoint fails, retry with the
other URL) is out of scope here — that's a follow-up.

Test plan

  • go test ./internal/repo/... passes (all 7 URL parse cases)
  • Set an SSH push URL (git remote set-url --push origin git@…),
    run fj issues — should resolve correctly
Fixes #26. ## Summary - `Detect()` now tries `git remote get-url --push` first; falls back to the fetch URL if the push URL can't be parsed - When no explicit push URL is configured, `--push` returns the fetch URL, so the common case is unaffected - Added test rows for `ssh://` and SCP-style URLs without `.git` suffix ## Notes API-time retry (if the derived HTTPS endpoint fails, retry with the other URL) is out of scope here — that's a follow-up. ## Test plan - [x] `go test ./internal/repo/...` passes (all 7 URL parse cases) - [x] Set an SSH push URL (`git remote set-url --push origin git@…`), run `fj issues` — should resolve correctly
fix: prefer push URL when detecting remote, cope with SSH forms
All checks were successful
nagonag (Push) / nagonag (push) Successful in 2m31s
3caa37c018
When a remote has both a fetch URL and an explicit push URL, use the
push one. Fall back to the fetch URL if the push URL can't be parsed.
"git remote get-url --push" returns the fetch URL when no pushurl is
configured, so the common case is unaffected.

Add test coverage for ssh:// and SCP-style URLs without .git suffix.

Fixes #26.

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
ius:ai:claude-sonnet-4-6

PASS: go test ./... passed.

PASS: go test ./... passed.
simplify: trim overexplained comment in Detect
All checks were successful
nagonag (Push) / nagonag (push) Successful in 2m32s
813859cfc2
Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
ius:ai:claude-sonnet-4-6

PASS: go test ./... passed.

PASS: go test ./... passed.
fix: restore insteadOf note, add TODO for Detect integration test
Some checks failed
nagonag (Push) / nagonag (push) Has been cancelled
f153f2b8f3
Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
ius:ai:claude-sonnet-4-6

PASS: go test ./... passed.

PASS: go test ./... passed.
heiko force-pushed fix/26-ssh-git-repo-urls from f153f2b8f3
Some checks failed
nagonag (Push) / nagonag (push) Has been cancelled
to ef5b368901
All checks were successful
nagonag (Push) / nagonag (push) Successful in 1m33s
2026-05-18 19:34:50 +02:00
Compare
heiko merged commit ead03c3a46 into master 2026-05-18 19:37:17 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
heiko/fj!27
No description provided.