(Json(req): Json<CreateWorktreeRequest>)
| 4176 | } |
| 4177 | |
| 4178 | async fn create_worktree(Json(req): Json<CreateWorktreeRequest>) -> Result<Json<WorktreeInfo>> { |
| 4179 | let cwd = std::env::current_dir().map_err(|e| ApiError::BadRequest(e.to_string()))?; |
| 4180 | |
| 4181 | let info = worktree::create_worktree(&cwd, req.branch.as_deref(), req.path.as_deref()) |
| 4182 | .map_err(|e| ApiError::BadRequest(e.to_string()))?; |
| 4183 | |
| 4184 | Ok(Json(info.into())) |
| 4185 | } |
| 4186 | |
| 4187 | #[derive(Debug, Deserialize)] |
| 4188 | pub struct RemoveWorktreeRequest { |
nothing calls this directly
no outgoing calls
no test coverage detected