Repository navigation
Select port-specific Git credentials during head resolution - #37
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Head resolution looked up credentials by
URL.hostname, which drops the port, while the staged clone helper uses Git'shost:port. A credential keyedgit.example:8443was skipped duringls-remoteand used during the clone. Switching toURL.hostmakes 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.hostinstead ofURL.hostname.docs/1_EXTENSION.md: a nondefault port is keyed ashost:port.gitconfirms the port-specific token is selected and a default-port token isn't reused for another port.Fixes #28.