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

Function remove_worktree

crates/opencode-server/src/routes.rs:4193–4200  ·  view source on GitHub ↗
(Json(req): Json<RemoveWorktreeRequest>)

Source from the content-addressed store, hash-verified

4191}
4192
4193async fn remove_worktree(Json(req): Json<RemoveWorktreeRequest>) -> Result<Json<bool>> {
4194 let cwd = std::env::current_dir().map_err(|e| ApiError::BadRequest(e.to_string()))?;
4195
4196 worktree::remove_worktree(&cwd, &req.path, req.force.unwrap_or(false))
4197 .map_err(|e| ApiError::BadRequest(e.to_string()))?;
4198
4199 Ok(Json(true))
4200}
4201
4202async fn reset_worktree() -> Result<Json<bool>> {
4203 let cwd = std::env::current_dir().map_err(|e| ApiError::BadRequest(e.to_string()))?;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected