mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 16:02:03 +00:00
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:
co-authored by
Orca
brennanb2025
parent
a65f7b4216
commit
659fe79226
@@ -38,6 +38,7 @@ vi.mock('fs', () => ({
|
||||
}))
|
||||
|
||||
import {
|
||||
abortMerge,
|
||||
bulkStageFiles,
|
||||
bulkDiscardChanges,
|
||||
bulkUnstageFiles,
|
||||
@@ -647,6 +648,20 @@ describe('getStatus', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('abortMerge', () => {
|
||||
beforeEach(() => {
|
||||
gitExecFileAsyncMock.mockReset()
|
||||
})
|
||||
|
||||
it('runs git merge --abort in the worktree', async () => {
|
||||
gitExecFileAsyncMock.mockResolvedValueOnce({ stdout: '' })
|
||||
|
||||
await abortMerge('/repo')
|
||||
|
||||
expect(gitExecFileAsyncMock).toHaveBeenCalledWith(['merge', '--abort'], { cwd: '/repo' })
|
||||
})
|
||||
})
|
||||
|
||||
describe('getStagedCommitContext', () => {
|
||||
beforeEach(() => {
|
||||
gitExecFileAsyncMock.mockReset()
|
||||
|
||||
@@ -459,6 +459,10 @@ export async function detectConflictOperation(worktreePath: string): Promise<Git
|
||||
return 'unknown'
|
||||
}
|
||||
|
||||
export async function abortMerge(worktreePath: string): Promise<void> {
|
||||
await gitExecFileAsync(['merge', '--abort'], { cwd: worktreePath })
|
||||
}
|
||||
|
||||
export async function resolveGitDir(worktreePath: string): Promise<string> {
|
||||
const dotGitPath = path.join(worktreePath, '.git')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user