fix: mcp_server_git: correct add logic for ["."] (#2379)

This commit is contained in:
Taj Baba
2025-08-11 16:39:26 +05:30
committed by GitHub
parent c9f7d0275c
commit a67e3b0a92
2 changed files with 28 additions and 2 deletions

View File

@@ -115,7 +115,10 @@ def git_commit(repo: git.Repo, message: str) -> str:
return f"Changes committed successfully with hash {commit.hexsha}"
def git_add(repo: git.Repo, files: list[str]) -> str:
repo.index.add(files)
if files == ["."]:
repo.git.add(".")
else:
repo.index.add(files)
return "Files staged successfully"
def git_reset(repo: git.Repo) -> str: