mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 17:17:38 +00:00
refactor(providers): an ssh: route carries no provider and throws one typed error (#27477)
Co-authored-by: m4air <m4air@Mac.localdomain>
This commit is contained in:
@@ -218,11 +218,7 @@ export async function getCurrentHeadOid(
|
||||
connectionId?: string | null,
|
||||
localGitOptions: { wslDistro?: string; admissionTier?: GitAdmissionTier } = {}
|
||||
): Promise<string | null> {
|
||||
const route = requireReachableGitRoute(getConnectionExecutionHostId(connectionId))
|
||||
if (route.kind === 'ssh') {
|
||||
const result = await route.provider.exec(['rev-parse', 'HEAD'], repoPath)
|
||||
return result.stdout.trim() || null
|
||||
}
|
||||
requireReachableGitRoute(getConnectionExecutionHostId(connectionId))
|
||||
try {
|
||||
const result = await gitExecFileAsync(['rev-parse', 'HEAD'], {
|
||||
cwd: repoPath,
|
||||
|
||||
@@ -134,14 +134,7 @@ export async function probeTrackedUpstreamBranches(
|
||||
upstreamsByBranchName: Map<string, TrackedUpstreamBranch | null>
|
||||
}> {
|
||||
const args = ['for-each-ref', '--format=%(refname)%00%(upstream)', 'refs/heads']
|
||||
const route = requireReachableGitRoute(getConnectionExecutionHostId(connectionId))
|
||||
if (route.kind === 'ssh') {
|
||||
const result = await route.provider.exec(args, repoPath)
|
||||
return {
|
||||
probeFailed: false,
|
||||
upstreamsByBranchName: parseTrackedUpstreamBranches(result.stdout)
|
||||
}
|
||||
}
|
||||
requireReachableGitRoute(getConnectionExecutionHostId(connectionId))
|
||||
try {
|
||||
const result = await gitExecFileAsync(args, {
|
||||
cwd: repoPath,
|
||||
|
||||
Reference in New Issue
Block a user