codeant-cli 0.4.12 → 0.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/scm/index.js +7 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeant-cli",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "description": "Code review CLI tool",
5
5
  "type": "module",
6
6
  "bin": {
package/src/scm/index.js CHANGED
@@ -65,10 +65,13 @@ export function detectRemote() {
65
65
  export function detectRepoName() {
66
66
  const origin = getOrigin();
67
67
  if (!origin) return null;
68
- // Handle SSH: git@github.com:owner/repo.git
69
- // Handle HTTPS: https://github.com/owner/repo.git
70
- const match = origin.match(/[/:]([\w.-]+(?:\/[\w.-]+)+?)(?:\.git)?$/);
71
- return match ? match[1] : null;
68
+ // SSH: git@host:path/to/repo[.git]
69
+ const sshMatch = origin.match(/^(?:[^@]+@)?[^:]+:(.+?)(?:\.git)?$/);
70
+ if (sshMatch) return sshMatch[1];
71
+ // HTTPS: https://[user:pass@]host/path/to/repo[.git]
72
+ const httpsMatch = origin.match(/^(?:https?|git):\/\/[^/]+\/(.+?)(?:\.git)?$/);
73
+ if (httpsMatch) return httpsMatch[1];
74
+ return null;
72
75
  }
73
76
 
74
77
  // Auto-detect default branch