@andre.buzeli/git-mcp 16.0.3 → 16.0.4
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
CHANGED
|
@@ -311,9 +311,11 @@ EXEMPLOS DE USO:
|
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
const organization = args.organization || undefined;
|
|
315
|
+
|
|
314
316
|
// Retry logic for push (often fails due to network or concurrent updates)
|
|
315
317
|
const result = await withRetry(
|
|
316
|
-
() => git.pushParallel(projectPath, branch, force),
|
|
318
|
+
() => git.pushParallel(projectPath, branch, force, organization),
|
|
317
319
|
3,
|
|
318
320
|
"push"
|
|
319
321
|
);
|
|
@@ -402,7 +404,7 @@ EXEMPLOS DE USO:
|
|
|
402
404
|
// 4. Push
|
|
403
405
|
const branch = await git.getCurrentBranch(projectPath);
|
|
404
406
|
const pushResult = await withRetry(
|
|
405
|
-
() => git.pushParallel(projectPath, branch, force),
|
|
407
|
+
() => git.pushParallel(projectPath, branch, force, organization),
|
|
406
408
|
3,
|
|
407
409
|
"push"
|
|
408
410
|
);
|
package/src/utils/gitAdapter.js
CHANGED
|
@@ -536,14 +536,14 @@ export class GitAdapter {
|
|
|
536
536
|
}
|
|
537
537
|
|
|
538
538
|
// ============ REMOTES ============
|
|
539
|
-
async ensureRemotes(dir, { githubUrl, giteaUrl }) {
|
|
539
|
+
async ensureRemotes(dir, { githubUrl, giteaUrl, organization } = {}) {
|
|
540
540
|
const remotesOutput = await this._exec(dir, ["remote", "-v"]);
|
|
541
541
|
const remotes = new Set(remotesOutput.split("\n").map(l => l.split("\t")[0]).filter(Boolean));
|
|
542
542
|
|
|
543
543
|
const repoName = getRepoNameFromPath(dir);
|
|
544
|
-
const calcUrls = await this.pm.getRemoteUrls(repoName);
|
|
545
|
-
const targetGithub = calcUrls.github
|
|
546
|
-
const targetGitea = calcUrls.gitea
|
|
544
|
+
const calcUrls = await this.pm.getRemoteUrls(repoName, organization);
|
|
545
|
+
const targetGithub = githubUrl || calcUrls.github;
|
|
546
|
+
const targetGitea = giteaUrl || calcUrls.gitea;
|
|
547
547
|
|
|
548
548
|
const setRemote = async (name, url) => {
|
|
549
549
|
if (!url) return;
|
|
@@ -615,8 +615,8 @@ export class GitAdapter {
|
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
|
|
618
|
-
async pushParallel(dir, branch, force = false) {
|
|
619
|
-
await this.ensureRemotes(dir, {});
|
|
618
|
+
async pushParallel(dir, branch, force = false, organization) {
|
|
619
|
+
await this.ensureRemotes(dir, { organization });
|
|
620
620
|
const remotesStr = await this._exec(dir, ["remote"]);
|
|
621
621
|
const remotes = remotesStr.split("\n").filter(r => ["github", "gitea"].includes(r.trim()));
|
|
622
622
|
|