MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / create_worktree

Function create_worktree

crates/opencode-server/src/routes.rs:4178–4185  ·  view source on GitHub ↗
(Json(req): Json<CreateWorktreeRequest>)

Source from the content-addressed store, hash-verified

4176}
4177
4178async 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)]
4188pub struct RemoveWorktreeRequest {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected