This commit is contained in:
Timothy Jaeryang Baek committed 2026-06-17 11:25:37 +02:00
1 parent 08d2afffc5
commit 6fdcbcfaa5
5 files changed
+246 -36

No files matched your search

+17
View File
@@ -25,6 +25,7 @@ from cptr.utils.git import (
log,
pull,
push,
rename_branch,
show,
stage,
stash_list,
@@ -145,6 +146,12 @@ class DeleteBranchRequest(BaseModel):
name: str
class RenameBranchRequest(BaseModel):
root: str
old_name: str
new_name: str
class RootRequest(BaseModel):
root: str
@@ -235,6 +242,16 @@ async def git_delete_branch(body: DeleteBranchRequest):
_handle_git_error(e)
@router.patch("/branch")
async def git_rename_branch(body: RenameBranchRequest):
"""Rename a local branch."""
try:
await rename_branch(body.root, body.old_name, body.new_name)
return {"ok": True}
except GitError as e:
_handle_git_error(e)
@router.post("/pull")
async def git_pull(body: RootRequest):
"""Pull from remote."""