Skip to content

Select port-specific Git credentials during head resolution - #37

Merged
jacobprall merged 3 commits into
mainfrom
codex/issue-28-git-credential-port
Oct 28, 2026
Merged

jacobprall merged 3 commits into
mainfrom
codex/issue-28-git-credential-port

Conversation

@starmorph

@starmorph starmorph commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Head resolution looked up credentials by URL.hostname, which drops the port, while the staged clone helper uses Git's host:port. A credential keyed git.example:8443 was skipped during ls-remote and used during the clone. Switching to URL.host makes both phases pick the same credential.

The original version of this PR also added host normalization (IPv4 aliases, leading-zero ports, duplicate detection) and a Node call inside the credential helper. That was trimmed to this one-line fix for the narrow case in the issue.

  • src/sandbox/render/snapshot.ts: URL.host instead of URL.hostname.
  • docs/1_EXTENSION.md: a nondefault port is keyed as host:port.
  • Tests: a shimmed git confirms the port-specific token is selected and a default-port token isn't reused for another port.

Fixes #28.

starmorph and others added 3 commits October 27, 2026 10:19
Head resolution looked up credentials by URL.hostname, which drops the port,
while the staged clone helper uses Git's host:port. Using URL.host makes both
phases select the same credential. Replaces the normalization layer and the
Node call in the credential helper with that one change and a focused test.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jacobprall jacobprall changed the title Preserve HTTPS ports in Git credential selection Select port-specific Git credentials during head resolution Oct 28, 2026
@jacobprall
jacobprall merged commit 1b814a9 into main Oct 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Preserve custom HTTPS ports in Git credential lookup

2 participants