feat(core): split vcs backend selection

This commit is contained in:
Shoubhit Dash 2026-07-06 18:19:13 +05:30
commit ef1c76a2bf
6 changed files with 125 additions and 32 deletions

View file

@ -4,12 +4,16 @@ import { AbsolutePath } from "@opencode-ai/core/schema"
import { Effect, Layer } from "effect"
import { tmpdir } from "./tmpdir"
export function location(ref: Location.Ref, input: { projectDirectory?: AbsolutePath; vcs?: Project.Vcs } = {}) {
export function location(
ref: Location.Ref,
input: { projectDirectory?: AbsolutePath; vcs?: Project.Vcs; vcsBackend?: Project.Vcs } = {},
) {
return {
directory: ref.directory,
workspaceID: ref.workspaceID,
project: { id: Project.ID.global, directory: input.projectDirectory ?? ref.directory },
vcs: input.vcs,
vcsBackend: input.vcsBackend ?? input.vcs,
} satisfies Location.Interface
}