@andre.buzeli/git-mcp 16.0.4 → 16.0.5
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/package.json +1 -1
- package/src/tools/git-workflow.js +16 -5
package/package.json
CHANGED
|
@@ -292,8 +292,13 @@ EXEMPLOS DE USO:
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
const ensured = await pm.ensureRepos({ repoName: repo, createIfMissing: true, isPublic, organization });
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
// Build URLs from actual ensureRepos results (handles GitHub fallback to personal account)
|
|
296
|
+
const githubUrl = ensured.github?.ok && ensured.github.repo
|
|
297
|
+
? `https://github.com/${ensured.github.repo}.git` : "";
|
|
298
|
+
const giteaBase = pm.giteaUrl?.replace(/\/$/, "");
|
|
299
|
+
const giteaUrl = ensured.gitea?.ok && ensured.gitea.repo && giteaBase
|
|
300
|
+
? `${giteaBase}/${ensured.gitea.repo}.git` : "";
|
|
301
|
+
await git.ensureRemotes(projectPath, { githubUrl, giteaUrl, organization });
|
|
297
302
|
const remotes = await git.listRemotes(projectPath);
|
|
298
303
|
return asToolResult({ success: true, ensured, remotes, isPrivate: !isPublic, organization: organization || undefined }, { tool: 'workflow', action: 'ensure-remotes' });
|
|
299
304
|
}
|
|
@@ -396,9 +401,15 @@ EXEMPLOS DE USO:
|
|
|
396
401
|
const organization = args.organization || undefined;
|
|
397
402
|
if (organization) {
|
|
398
403
|
const repo = getRepoNameFromPath(projectPath);
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
|
|
404
|
+
const isPublic = args.isPublic === true;
|
|
405
|
+
const ensured = await pm.ensureRepos({ repoName: repo, createIfMissing: true, isPublic, organization });
|
|
406
|
+
// Build URLs from actual ensureRepos results (handles GitHub fallback to personal account)
|
|
407
|
+
const githubUrl = ensured.github?.ok && ensured.github.repo
|
|
408
|
+
? `https://github.com/${ensured.github.repo}.git` : "";
|
|
409
|
+
const giteaBase = pm.giteaUrl?.replace(/\/$/, "");
|
|
410
|
+
const giteaUrl = ensured.gitea?.ok && ensured.gitea.repo && giteaBase
|
|
411
|
+
? `${giteaBase}/${ensured.gitea.repo}.git` : "";
|
|
412
|
+
await git.ensureRemotes(projectPath, { githubUrl, giteaUrl, organization });
|
|
402
413
|
}
|
|
403
414
|
|
|
404
415
|
// 4. Push
|