feat: add source control action to abort merge (#2092)

Co-authored-by: Orca <help@stably.ai>
Co-authored-by: brennanb2025 <brennankbenson@gmail.com>
This commit is contained in:
Leynier Gutiérrez González
2026-05-27 14:59:23 -07:00
committed by GitHub
co-authored by Orca brennanb2025
parent a65f7b4216
commit 659fe79226
25 changed files with 478 additions and 7 deletions
+14
View File
@@ -761,6 +761,7 @@ describe('OrcaRuntimeRpcServer', () => {
.fn()
.mockResolvedValue({ hasUpstream: true, ahead: 1, behind: 0 })
const rebaseRuntimeGitFromBase = vi.fn().mockResolvedValue({ ok: true })
const abortRuntimeGitMerge = vi.fn().mockResolvedValue({ ok: true })
const bulkStageRuntimeGitPaths = vi.fn().mockResolvedValue({ ok: true })
const bulkUnstageRuntimeGitPaths = vi.fn().mockResolvedValue({ ok: true })
const getRuntimeGitDiff = vi.fn().mockResolvedValue({
@@ -842,6 +843,7 @@ describe('OrcaRuntimeRpcServer', () => {
getRuntimeGitStatus,
getRuntimeGitUpstreamStatus,
rebaseRuntimeGitFromBase,
abortRuntimeGitMerge,
bulkStageRuntimeGitPaths,
bulkUnstageRuntimeGitPaths,
getRuntimeGitDiff,
@@ -1400,6 +1402,16 @@ describe('OrcaRuntimeRpcServer', () => {
(response) => replies.push(JSON.parse(response) as Record<string, unknown>),
() => {}
)
await server['handleWebSocketMessage'](
JSON.stringify({
id: 'req_git_abort_merge',
method: 'git.abortMerge',
deviceToken: mobile.token,
params: { worktree: 'id:wt-1' }
}),
(response) => replies.push(JSON.parse(response) as Record<string, unknown>),
() => {}
)
await server['handleWebSocketMessage'](
JSON.stringify({
id: 'req_git_bulk_unstage',
@@ -1612,6 +1624,7 @@ describe('OrcaRuntimeRpcServer', () => {
expect.objectContaining({ id: 'req_git_rebase_from_base', ok: true })
)
expect(replies).toContainEqual(expect.objectContaining({ id: 'req_git_bulk_stage', ok: true }))
expect(replies).toContainEqual(expect.objectContaining({ id: 'req_git_abort_merge', ok: true }))
expect(replies).toContainEqual(
expect.objectContaining({ id: 'req_git_bulk_unstage', ok: true })
)
@@ -1646,6 +1659,7 @@ describe('OrcaRuntimeRpcServer', () => {
expect(pushRuntimeGit).toHaveBeenCalledWith('id:wt-1', true, undefined, undefined)
expect(getRuntimeGitUpstreamStatus).toHaveBeenCalledWith('id:wt-1')
expect(bulkStageRuntimeGitPaths).toHaveBeenCalledWith('id:wt-1', ['a.ts', 'b.ts'])
expect(abortRuntimeGitMerge).toHaveBeenCalledWith('id:wt-1')
expect(bulkUnstageRuntimeGitPaths).toHaveBeenCalledWith('id:wt-1', ['c.ts'])
expect(openMobileDiff).toHaveBeenCalledWith('id:wt-1', 'docs/readme.md', true)
expect(getRuntimeGitDiff).toHaveBeenCalledWith('id:wt-1', 'docs/readme.md', false, undefined)