feat(mobile): pickers, workspace parity, active-workspace focus, tap-to-open, source-control parity, artifact viewing (#5330)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -43,6 +43,8 @@ import {
|
||||
stageFile,
|
||||
unstageFile
|
||||
} from '../git/status'
|
||||
import { checkoutBranch, listLocalBranches } from '../git/checkout'
|
||||
import type { RuntimeGitCheckoutResult, RuntimeGitLocalBranches } from '../../shared/runtime-types'
|
||||
import { getHistory as getGitHistory } from '../git/history'
|
||||
import { getUpstreamStatus } from '../git/upstream'
|
||||
import { gitFastForward, gitFetch, gitPull, gitPullRebaseFromBase, gitPush } from '../git/remote'
|
||||
@@ -213,6 +215,35 @@ export class RuntimeGitCommands {
|
||||
return { ok: true }
|
||||
}
|
||||
|
||||
async checkoutRuntimeGitBranch(
|
||||
worktreeSelector: string,
|
||||
branch: string
|
||||
): Promise<RuntimeGitCheckoutResult> {
|
||||
const target = await this.host.resolveRuntimeGitTarget(worktreeSelector)
|
||||
const provider = target.connectionId ? getSshGitProvider(target.connectionId) : null
|
||||
if (target.connectionId) {
|
||||
if (!provider) {
|
||||
throw new Error(SSH_GIT_PROVIDER_UNAVAILABLE_MESSAGE)
|
||||
}
|
||||
await provider.checkoutBranch(target.worktree.path, branch)
|
||||
return { ok: true, branch }
|
||||
}
|
||||
await checkoutBranch(target.worktree.path, branch)
|
||||
return { ok: true, branch }
|
||||
}
|
||||
|
||||
async listRuntimeGitLocalBranches(worktreeSelector: string): Promise<RuntimeGitLocalBranches> {
|
||||
const target = await this.host.resolveRuntimeGitTarget(worktreeSelector)
|
||||
const provider = target.connectionId ? getSshGitProvider(target.connectionId) : null
|
||||
if (target.connectionId) {
|
||||
if (!provider) {
|
||||
throw new Error(SSH_GIT_PROVIDER_UNAVAILABLE_MESSAGE)
|
||||
}
|
||||
return provider.listLocalBranches(target.worktree.path)
|
||||
}
|
||||
return listLocalBranches(target.worktree.path)
|
||||
}
|
||||
|
||||
async getRuntimeGitDiff(
|
||||
worktreeSelector: string,
|
||||
filePath: string,
|
||||
|
||||
Reference in New Issue
Block a user