Refactor runtime app architecture (#1878)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo Hong
2026-05-14 23:13:37 -07:00
committed by GitHub
co-authored by Orca
parent 89827117e5
commit a22717bb35
308 changed files with 32140 additions and 4464 deletions
+8 -4
View File
@@ -220,10 +220,14 @@ describe('getDiff', () => {
const result = await getDiff('/repo', 'src/file.ts', false)
expect(gitExecFileAsyncBufferMock).toHaveBeenNthCalledWith(2, ['show', 'HEAD:src/file.ts'], {
cwd: '/repo',
maxBuffer: 10 * 1024 * 1024
})
expect(gitExecFileAsyncBufferMock).toHaveBeenNthCalledWith(
2,
['show', '--end-of-options', 'HEAD:src/file.ts'],
{
cwd: '/repo',
maxBuffer: 10 * 1024 * 1024
}
)
expect(result.originalContent).toBe('head-content\n')
expect(result.modifiedContent).toBe('working-tree-content')
})
+8 -5
View File
@@ -551,7 +551,7 @@ async function resolveCompareRef(worktreePath: string): Promise<string> {
}
async function resolveRefOid(worktreePath: string, ref: string): Promise<string> {
const { stdout } = await gitExecFileAsync(['rev-parse', '--verify', ref], {
const { stdout } = await gitExecFileAsync(['rev-parse', '--verify', '--end-of-options', ref], {
cwd: worktreePath
})
return stdout.trim()
@@ -613,10 +613,13 @@ async function readGitBlobAtOidPath(
filePath: string
): Promise<GitBlobReadResult> {
try {
const { stdout } = await gitExecFileAsyncBuffer(['show', `${oid}:${filePath}`], {
cwd: worktreePath,
maxBuffer: MAX_GIT_SHOW_BYTES
})
const { stdout } = await gitExecFileAsyncBuffer(
['show', '--end-of-options', `${oid}:${filePath}`],
{
cwd: worktreePath,
maxBuffer: MAX_GIT_SHOW_BYTES
}
)
return { ...bufferToBlob(stdout, filePath), exists: true }
} catch {