@@ -8,12 +8,10 @@ import * as FileSystem from "effect/FileSystem";
88import * as Layer from "effect/Layer" ;
99import * as Option from "effect/Option" ;
1010import * as Path from "effect/Path" ;
11- import * as PlatformError from "effect/PlatformError" ;
1211import { ChildProcessSpawner } from "effect/process" ;
1312
1413import {
1514 GitCommandError ,
16- type VcsError ,
1715 VcsProcessExitError ,
1816 type VcsSwitchRefInput ,
1917 type VcsSwitchRefResult ,
@@ -34,6 +32,7 @@ import {
3432 type VcsStatusResult ,
3533 type WorktreeSubmodules ,
3634} from "@t3tools/contracts" ;
35+ import { isMissingExecutable } from "@t3tools/source-control-core/server/discovery" ;
3736import {
3837 makeGitVcsDriverCore ,
3938 PATCH_RENDER_PREFIX_ARGS ,
@@ -522,14 +521,6 @@ const gitCommand = (
522521 : { } ) ,
523522 } ) ;
524523
525- // Spawning a git that is not installed. Repository detection reads this as "not a repository".
526- const isMissingGitExecutable = ( error : VcsError ) =>
527- error . _tag === "VcsProcessSpawnError" &&
528- error . cause instanceof PlatformError . PlatformError &&
529- error . cause . reason . _tag === "NotFound" &&
530- error . cause . reason . module === "ChildProcess" &&
531- error . cause . reason . method === "spawn" ;
532-
533524export const makeVcsDriverShape = Effect . fn ( "makeGitVcsDriverShape" ) ( function * ( ) {
534525 const fileSystem = yield * FileSystem . FileSystem ;
535526 const path = yield * Path . Path ;
@@ -557,7 +548,8 @@ export const makeVcsDriverShape = Effect.fn("makeGitVcsDriverShape")(function* (
557548 } ,
558549 ) . pipe (
559550 Effect . map ( ( result ) => result . exitCode === 0 && result . stdout . trim ( ) === "true" ) ,
560- Effect . catchIf ( isMissingGitExecutable , ( ) => Effect . succeed ( false ) ) ,
551+ // A git that is not installed reads as "not a repository", as a missing hosting CLI does in discovery.
552+ Effect . catchIf ( isMissingExecutable , ( ) => Effect . succeed ( false ) ) ,
561553 ) ;
562554
563555 const execute : VcsDriver . VcsDriver [ "Service" ] [ "execute" ] = ( input ) =>
0 commit comments