mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-10 07:11:25 +03:00
476432de1e
Co-authored-by: Hona <10430890+Hona@users.noreply.github.com>
18 lines
612 B
TypeScript
18 lines
612 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import path from "path"
|
|
import { resolveGitExecutable } from "@opencode/core/util/git-executable"
|
|
|
|
describe("Git executable", () => {
|
|
test("uses an absolute executable on Windows", () => {
|
|
expect(resolveGitExecutable("win32", "bin/git.exe")).toBe(path.resolve("bin/git.exe"))
|
|
})
|
|
|
|
test("leaves lookup to the process outside Windows", () => {
|
|
expect(resolveGitExecutable("linux", "/usr/bin/git")).toBe("git")
|
|
})
|
|
|
|
test("falls back to PATH lookup when Git is unresolved", () => {
|
|
expect(resolveGitExecutable("win32", null)).toBe("git")
|
|
})
|
|
})
|