@@ -1161,11 +1161,16 @@ const vcsProcessSpawning = (command: string) =>
11611161
11621162it . effect ( "GitVcsDriver treats a missing git executable as outside any repository" , ( ) =>
11631163 Effect . gen ( function * ( ) {
1164- const driver = yield * GitVcsDriver . makeVcsDriverShape ( ) ;
1164+ const fileSystem = yield * FileSystem . FileSystem ;
1165+ const path = yield * Path . Path ;
1166+ const cwd = yield * fileSystem . makeTempDirectoryScoped ( { prefix : "t3-missing-git-" } ) ;
1167+ const driver = yield * GitVcsDriver . makeVcsDriverShape ( ) . pipe (
1168+ Effect . provide ( vcsProcessSpawning ( path . join ( cwd , "git" ) ) ) ,
1169+ ) ;
11651170
1166- assert . equal ( yield * driver . isInsideWorkTree ( process . cwd ( ) ) , false ) ;
1167- assert . equal ( yield * driver . detectRepository ( process . cwd ( ) ) , null ) ;
1168- } ) . pipe ( Effect . provide ( vcsProcessSpawning ( "t3-missing-git-executable" ) ) ) ,
1171+ assert . strictEqual ( yield * driver . isInsideWorkTree ( cwd ) , false ) ;
1172+ assert . strictEqual ( yield * driver . detectRepository ( cwd ) , null ) ;
1173+ } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
11691174) ;
11701175
11711176it . effect . skipIf ( HostProcess . Platform . defaultValue ( ) === "win32" ) (
@@ -1181,6 +1186,8 @@ it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")(
11811186
11821187 const error = yield * driver . isInsideWorkTree ( process . cwd ( ) ) . pipe ( Effect . flip ) ;
11831188 assert . strictEqual ( error . _tag , "VcsProcessSpawnError" ) ;
1189+ const detectionError = yield * driver . detectRepository ( process . cwd ( ) ) . pipe ( Effect . flip ) ;
1190+ assert . strictEqual ( detectionError . _tag , "VcsProcessSpawnError" ) ;
11841191 } ) . pipe ( Effect . scoped , Effect . provide ( NodeServices . layer ) ) ,
11851192) ;
11861193
0 commit comments