Skip to content

Commit 705237e

Browse files
pranavcodeantclaude
andcommitted
Fix SSH regex to not greedily match HTTPS URLs via negative lookahead
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 180c663 commit 705237e

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeant-cli",
3-
"version": "0.4.13",
3+
"version": "0.4.14",
44
"description": "Code review CLI tool",
55
"type": "module",
66
"bin": {

src/scm/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function detectRepoName() {
6666
const origin = getOrigin();
6767
if (!origin) return null;
6868
// SSH: git@host:path/to/repo[.git]
69-
const sshMatch = origin.match(/^(?:[^@]+@)?[^:]+:(.+?)(?:\.git)?$/);
69+
const sshMatch = origin.match(/^(?:[^@]+@)?[^:]+:(?!\/\/)(.+?)(?:\.git)?$/);
7070
if (sshMatch) return sshMatch[1];
7171
// HTTPS: https://[user:pass@]host/path/to/repo[.git]
7272
const httpsMatch = origin.match(/^(?:https?|git):\/\/[^/]+\/(.+?)(?:\.git)?$/);

0 commit comments

Comments
 (0)