@@ -467,7 +467,7 @@ it.layer(layerBase, { excludeTestServices: true })("PullRequestReviewGuideServic
467467 ) ,
468468 ) ;
469469
470- it . effect ( "keeps excerpts of source lines a configured diff driver would convert away " , ( ) =>
470+ it . effect ( "keeps excerpts despite the checkout's diff driver and a failing hook " , ( ) =>
471471 Effect . scoped (
472472 Effect . gen ( function * ( ) {
473473 const repositories = yield * makeRepositories ;
@@ -477,6 +477,9 @@ it.layer(layerBase, { excludeTestServices: true })("PullRequestReviewGuideServic
477477 "feature.txt diff=blank\n" ,
478478 ) ;
479479 yield * git ( repositories . workspace , [ "config" , "diff.blank.textconv" , "true" ] ) ;
480+ const hook = `${ repositories . workspace } /.git/hooks/post-checkout` ;
481+ yield * fs . writeFileString ( hook , "#!/bin/sh\nexit 1\n" ) ;
482+ yield * fs . chmod ( hook , 0o755 ) ;
480483 const stored = yield * Deferred . make < void > ( ) ;
481484 const context = yield * Layer . build (
482485 makeLayer ( {
@@ -502,9 +505,10 @@ it.layer(layerBase, { excludeTestServices: true })("PullRequestReviewGuideServic
502505 context ,
503506 PullRequestReviewGuideService . PullRequestReviewGuideService ,
504507 ) ;
505- yield * service . generate ( reference ) ;
506- yield * Deferred . await ( stored ) ;
507- const result = yield * service . get ( reference ) ;
508+ const runs = yield * watchRuns ;
509+ yield * runs . generate ( service , reference ) ;
510+ const result = yield * runs . settled ( service , reference ) ;
511+ assert . notStrictEqual ( result . run ?. _tag , "Failed" , JSON . stringify ( result . run ) ) ;
508512 assert . deepStrictEqual ( result . guide ?. stops [ 0 ] ?. excerpts , [
509513 { path : "feature.txt" , side : "new" , start : 1 , end : 3 , caption : "" } ,
510514 ] ) ;
0 commit comments