@@ -102,16 +102,16 @@ def git_log(repo: git.Repo, max_count: int = 10) -> list[str]:
102102 log = []
103103 for commit in commits :
104104 log .append (
105- f"Commit: { commit .hexsha } \n "
106- f"Author: { commit .author } \n "
105+ f"Commit: { commit .hexsha !r } \n "
106+ f"Author: { commit .author !r } \n "
107107 f"Date: { commit .authored_datetime } \n "
108- f"Message: { commit .message } \n "
108+ f"Message: { commit .message !r } \n "
109109 )
110110 return log
111111
112112def git_create_branch (repo : git .Repo , branch_name : str , base_branch : str | None = None ) -> str :
113113 if base_branch :
114- base = repo .refs [base_branch ]
114+ base = repo .references [base_branch ]
115115 else :
116116 base = repo .active_branch
117117
@@ -132,10 +132,10 @@ def git_init(repo_path: str) -> str:
132132def git_show (repo : git .Repo , revision : str ) -> str :
133133 commit = repo .commit (revision )
134134 output = [
135- f"Commit: { commit .hexsha } \n "
136- f"Author: { commit .author } \n "
137- f"Date: { commit .authored_datetime } \n "
138- f"Message: { commit .message } \n "
135+ f"Commit: { commit .hexsha !r } \n "
136+ f"Author: { commit .author !r } \n "
137+ f"Date: { commit .authored_datetime !r } \n "
138+ f"Message: { commit .message !r } \n "
139139 ]
140140 if commit .parents :
141141 parent = commit .parents [0 ]
@@ -166,62 +166,62 @@ async def list_tools() -> list[Tool]:
166166 Tool (
167167 name = GitTools .STATUS ,
168168 description = "Shows the working tree status" ,
169- inputSchema = GitStatus .schema (),
169+ inputSchema = GitStatus .model_json_schema (),
170170 ),
171171 Tool (
172172 name = GitTools .DIFF_UNSTAGED ,
173173 description = "Shows changes in the working directory that are not yet staged" ,
174- inputSchema = GitDiffUnstaged .schema (),
174+ inputSchema = GitDiffUnstaged .model_json_schema (),
175175 ),
176176 Tool (
177177 name = GitTools .DIFF_STAGED ,
178178 description = "Shows changes that are staged for commit" ,
179- inputSchema = GitDiffStaged .schema (),
179+ inputSchema = GitDiffStaged .model_json_schema (),
180180 ),
181181 Tool (
182182 name = GitTools .DIFF ,
183183 description = "Shows differences between branches or commits" ,
184- inputSchema = GitDiff .schema (),
184+ inputSchema = GitDiff .model_json_schema (),
185185 ),
186186 Tool (
187187 name = GitTools .COMMIT ,
188188 description = "Records changes to the repository" ,
189- inputSchema = GitCommit .schema (),
189+ inputSchema = GitCommit .model_json_schema (),
190190 ),
191191 Tool (
192192 name = GitTools .ADD ,
193193 description = "Adds file contents to the staging area" ,
194- inputSchema = GitAdd .schema (),
194+ inputSchema = GitAdd .model_json_schema (),
195195 ),
196196 Tool (
197197 name = GitTools .RESET ,
198198 description = "Unstages all staged changes" ,
199- inputSchema = GitReset .schema (),
199+ inputSchema = GitReset .model_json_schema (),
200200 ),
201201 Tool (
202202 name = GitTools .LOG ,
203203 description = "Shows the commit logs" ,
204- inputSchema = GitLog .schema (),
204+ inputSchema = GitLog .model_json_schema (),
205205 ),
206206 Tool (
207207 name = GitTools .CREATE_BRANCH ,
208208 description = "Creates a new branch from an optional base branch" ,
209- inputSchema = GitCreateBranch .schema (),
209+ inputSchema = GitCreateBranch .model_json_schema (),
210210 ),
211211 Tool (
212212 name = GitTools .CHECKOUT ,
213213 description = "Switches branches" ,
214- inputSchema = GitCheckout .schema (),
214+ inputSchema = GitCheckout .model_json_schema (),
215215 ),
216216 Tool (
217217 name = GitTools .SHOW ,
218218 description = "Shows the contents of a commit" ,
219- inputSchema = GitShow .schema (),
219+ inputSchema = GitShow .model_json_schema (),
220220 ),
221221 Tool (
222222 name = GitTools .INIT ,
223223 description = "Initialize a new Git repository" ,
224- inputSchema = GitInit .schema (),
224+ inputSchema = GitInit .model_json_schema (),
225225 )
226226 ]
227227
0 commit comments