1010from openhands .sdk .git .git_changes import get_git_changes
1111from openhands .sdk .git .git_diff import get_git_diff
1212from openhands .sdk .git .models import GitChange , GitDiff
13+ from openhands .sdk .utils .deprecation import deprecated
1314
1415
1516git_router = APIRouter (prefix = "/git" , tags = ["Git" ])
@@ -39,6 +40,15 @@ async def git_changes_query(
3940
4041
4142@git_router .get ("/changes/{path:path}" )
43+ @deprecated (
44+ deprecated_in = "1.15.0" ,
45+ removed_in = "1.20.0" ,
46+ details = (
47+ "Use the /git/changes endpoint with a query parameter for the path "
48+ "instead of a path parameter. This allows for better handling of "
49+ "complex paths and is more consistent with other endpoints."
50+ ),
51+ )
4252async def git_changes_path (path : str ) -> list [GitChange ]:
4353 """Get git changes using path parameter (legacy, for backwards compatibility)."""
4454 return await _get_git_changes (path )
@@ -53,6 +63,15 @@ async def git_diff_query(
5363
5464
5565@git_router .get ("/diff/{path:path}" )
66+ @deprecated (
67+ deprecated_in = "1.15.0" ,
68+ removed_in = "1.20.0" ,
69+ details = (
70+ "Use the /git/changes endpoint with a query parameter for the path "
71+ "instead of a path parameter. This allows for better handling of "
72+ "complex paths and is more consistent with other endpoints."
73+ ),
74+ )
5675async def git_diff_path (path : str ) -> GitDiff :
5776 """Get git diff using path parameter (legacy, for backwards compatibility)."""
5877 return await _get_git_diff (path )
0 commit comments