mirror of
https://github.com/stablyai/orca.git
synced 2026-10-27 08:02:51 +00:00
fix(worktrees): bound shared worktree list scans (#9786)
This commit is contained in:
@@ -41,6 +41,7 @@ import {
|
||||
forceDeleteLocalBranch,
|
||||
listWorktrees,
|
||||
removeWorktree,
|
||||
WORKTREE_LIST_TIMEOUT_MS,
|
||||
WORKTREE_REMOVAL_PREFLIGHT_TIMEOUT_MS
|
||||
} from './worktree'
|
||||
|
||||
@@ -1009,7 +1010,8 @@ describe('listWorktrees', () => {
|
||||
])
|
||||
expect(gitExecFileAsyncMock).toHaveBeenCalledWith(['worktree', 'list', '--porcelain', '-z'], {
|
||||
cwd: 'C:\\Users\\me\\repo',
|
||||
wslDistro: 'Ubuntu'
|
||||
wslDistro: 'Ubuntu',
|
||||
timeout: WORKTREE_LIST_TIMEOUT_MS
|
||||
})
|
||||
expect(translateWslOutputPathsMock).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
@@ -1030,7 +1032,8 @@ describe('listWorktrees', () => {
|
||||
await expect(listWorktrees('/workspace/deleted-repo')).resolves.toEqual([])
|
||||
|
||||
expect(gitExecFileAsyncMock).toHaveBeenCalledWith(['worktree', 'list', '--porcelain', '-z'], {
|
||||
cwd: '/workspace/deleted-repo'
|
||||
cwd: '/workspace/deleted-repo',
|
||||
timeout: WORKTREE_LIST_TIMEOUT_MS
|
||||
})
|
||||
expect(statMock).toHaveBeenCalledWith('/workspace/deleted-repo')
|
||||
expect(warnSpy).toHaveBeenCalledWith(
|
||||
@@ -1052,7 +1055,8 @@ describe('listWorktrees', () => {
|
||||
await expect(listWorktrees('/private/tmp/orca-issue-1582-test/my-repo')).resolves.toEqual([])
|
||||
|
||||
expect(gitExecFileAsyncMock).toHaveBeenCalledWith(['worktree', 'list', '--porcelain', '-z'], {
|
||||
cwd: '/private/tmp/orca-issue-1582-test/my-repo'
|
||||
cwd: '/private/tmp/orca-issue-1582-test/my-repo',
|
||||
timeout: WORKTREE_LIST_TIMEOUT_MS
|
||||
})
|
||||
expect(warnSpy).not.toHaveBeenCalled()
|
||||
warnSpy.mockRestore()
|
||||
|
||||
Reference in New Issue
Block a user