@andrebuzeli/git-mcp 15.12.0 → 15.12.2
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/index.js +1 -1
- package/src/tools/git-workflow.js +13 -6
- package/src/utils/gitAdapter.js +1 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -47,7 +47,7 @@ if (!hasGitHub && !hasGitea) {
|
|
|
47
47
|
|
|
48
48
|
const transport = new StdioServerTransport();
|
|
49
49
|
const server = new Server(
|
|
50
|
-
{ name: "git-
|
|
50
|
+
{ name: "git-mcp", version: "15.12.2" },
|
|
51
51
|
{ capabilities: { tools: {}, resources: {}, prompts: {} } }
|
|
52
52
|
);
|
|
53
53
|
server.connect(transport);
|
|
@@ -119,16 +119,23 @@ EXEMPLOS DE USO:
|
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
await git.
|
|
122
|
+
const isRepo = await git.isRepo(projectPath);
|
|
123
|
+
if (!isRepo) {
|
|
124
|
+
await git.init(projectPath);
|
|
125
|
+
}
|
|
123
126
|
|
|
124
|
-
// Criar .gitignore baseado no tipo de projeto
|
|
127
|
+
// Criar .gitignore baseado no tipo de projeto (apenas se não existir ou se for novo repo)
|
|
125
128
|
const shouldCreateGitignore = args.createGitignore !== false;
|
|
126
129
|
let gitignoreCreated = false;
|
|
130
|
+
|
|
127
131
|
if (shouldCreateGitignore) {
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
const hasGitignore = fs.existsSync(path.join(projectPath, ".gitignore"));
|
|
133
|
+
if (!hasGitignore) {
|
|
134
|
+
const projectType = detectProjectType(projectPath);
|
|
135
|
+
const patterns = GITIGNORE_TEMPLATES[projectType] || GITIGNORE_TEMPLATES.general;
|
|
136
|
+
await git.createGitignore(projectPath, patterns);
|
|
137
|
+
gitignoreCreated = true;
|
|
138
|
+
}
|
|
132
139
|
}
|
|
133
140
|
|
|
134
141
|
const repo = getRepoNameFromPath(projectPath);
|
package/src/utils/gitAdapter.js
CHANGED
|
@@ -159,7 +159,7 @@ export class GitAdapter {
|
|
|
159
159
|
|
|
160
160
|
if (shouldDelete) {
|
|
161
161
|
// Espera um pouco para o sistema de arquivos (especialmente SMB) registrar
|
|
162
|
-
await new Promise(r => setTimeout(r,
|
|
162
|
+
await new Promise(r => setTimeout(r, 5000));
|
|
163
163
|
return await this._exec(dir, args, { ...options, _lockRetried: true });
|
|
164
164
|
}
|
|
165
165
|
}
|