Bug Description
When adding an SSH credential with the host format [email protected], the credential is not matched when trying to clone a repository. The clone fails with "Permission denied (publickey)".
Steps to Reproduce
- Go to Settings > Git Credentials
- Add an SSH credential with host [email protected] (the pre-filled format when selecting SSH type)
- Save the credential
- Try to clone a repo from that host, e.g., [email protected]:user/repo.git
- Clone fails with authentication error
Expected Behavior
SSH credential should match and authentication should succeed.
Root Cause
- Frontend pre-fills [email protected] when selecting SSH type (frontend/src/components/settings/GitCredentialDialog.tsx:180), suggesting this format is valid
- Backend's getSSHCredentialsForHost (backend/src/utils/git-auth.ts:130) doesn't normalize the git@ prefix
- When cloning, extractHostFromSSHUrl extracts just bitbucket.org from the repo URL
- Comparison: [email protected] ≠ bitbucket.org → no match found
Bug Description
When adding an SSH credential with the host format [email protected], the credential is not matched when trying to clone a repository. The clone fails with "Permission denied (publickey)".
Steps to Reproduce
Expected Behavior
SSH credential should match and authentication should succeed.
Root Cause