threadlines 0.1.9 → 0.1.10
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.
- package/dist/git/repo.js +10 -2
- package/package.json +1 -1
package/dist/git/repo.js
CHANGED
|
@@ -16,10 +16,16 @@ async function getRepoName(repoRoot) {
|
|
|
16
16
|
try {
|
|
17
17
|
const remotes = await git.getRemotes(true);
|
|
18
18
|
const origin = remotes.find(r => r.name === 'origin');
|
|
19
|
-
if (!origin
|
|
19
|
+
if (!origin) {
|
|
20
|
+
console.log(' [DEBUG] No origin remote found');
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (!origin.refs?.fetch) {
|
|
24
|
+
console.log(' [DEBUG] Origin remote found but no fetch URL');
|
|
20
25
|
return null;
|
|
21
26
|
}
|
|
22
27
|
const url = origin.refs.fetch;
|
|
28
|
+
console.log(` [DEBUG] Git remote URL: ${url}`);
|
|
23
29
|
// Parse repo name from common URL formats:
|
|
24
30
|
// - https://github.com/user/repo.git
|
|
25
31
|
// - git@github.com:user/repo.git
|
|
@@ -32,13 +38,15 @@ async function getRepoName(repoRoot) {
|
|
|
32
38
|
for (const pattern of patterns) {
|
|
33
39
|
const match = url.match(pattern);
|
|
34
40
|
if (match && match[1]) {
|
|
41
|
+
console.log(` [DEBUG] Matched repo name: ${match[1]}`);
|
|
35
42
|
return match[1];
|
|
36
43
|
}
|
|
37
44
|
}
|
|
45
|
+
console.log(' [DEBUG] No pattern matched the remote URL');
|
|
38
46
|
return null;
|
|
39
47
|
}
|
|
40
48
|
catch (error) {
|
|
41
|
-
|
|
49
|
+
console.log(` [DEBUG] Error getting repo name: ${error.message}`);
|
|
42
50
|
return null;
|
|
43
51
|
}
|
|
44
52
|
}
|