@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrebuzeli/git-mcp",
3
- "version": "15.12.0",
3
+ "version": "15.12.2",
4
4
  "private": false,
5
5
  "description": "MCP server para Git com operações locais e sincronização paralela GitHub/Gitea",
6
6
  "license": "MIT",
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-mcpv2", version: "15.11.6" },
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.init(projectPath);
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 projectType = detectProjectType(projectPath);
129
- const patterns = GITIGNORE_TEMPLATES[projectType] || GITIGNORE_TEMPLATES.general;
130
- await git.createGitignore(projectPath, patterns);
131
- gitignoreCreated = true;
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);
@@ -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, 2000));
162
+ await new Promise(r => setTimeout(r, 5000));
163
163
  return await this._exec(dir, args, { ...options, _lockRetried: true });
164
164
  }
165
165
  }