feat(workspace): WorktreeService with acquire/release state machine

This commit is contained in:
2026-05-02 08:03:30 +08:00
parent bd91880898
commit d76ed67666
6 changed files with 325 additions and 0 deletions
+4
View File
@@ -7,6 +7,10 @@ RETURNING *;
-- name: GetWorktreeByID :one
SELECT * FROM workspace_worktrees WHERE id = $1;
-- name: GetWorktreeByIDForUpdate :one
SELECT * FROM workspace_worktrees WHERE id = $1
FOR UPDATE;
-- name: GetWorktreeByBranchForUpdate :one
SELECT * FROM workspace_worktrees
WHERE workspace_id = $1 AND branch = $2