@@ -3906,7 +3906,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
39063906 return { repoDir, manager, providerCalls, firstCommit, pullHead } ;
39073907 } ) ;
39083908
3909- it . effect . each ( [ "switch" , "create-and-switch" , "feature-branch" ] as const ) (
3909+ it . effect . each ( [ "switch" , "create-and-switch" , "feature-branch" , "commit" ] as const ) (
39103910 "local PR checkout excludes a concurrent %s from a nested project with an alternate root" ,
39113911 ( operation ) =>
39123912 Effect . gen ( function * ( ) {
@@ -3956,7 +3956,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
39563956 ...manager ,
39573957 runStackedAction : ( input , options ) =>
39583958 Effect . sync ( ( ) => {
3959- events . push ( "feature-branch" ) ;
3959+ events . push ( input . featureBranch ? "feature-branch" : "commit ") ;
39603960 NodeFS . writeFileSync (
39613961 NodePath . join ( repoDir , "second-client.txt" ) ,
39623962 "second client\n" ,
@@ -3993,9 +3993,9 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
39933993 } )
39943994 : workflows [ 1 ] ! . runStackedAction ( {
39953995 cwd : nestedCwd ,
3996- actionId : " second-client-feature-branch" ,
3996+ actionId : ` second-client-${ operation } ` ,
39973997 action : "commit" ,
3998- featureBranch : true ,
3998+ featureBranch : operation === "feature-branch" ,
39993999 commitMessage : "Second client commit" ,
40004000 } ) ,
40014001 { startImmediately : true } ,
@@ -4008,15 +4008,16 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
40084008 expect ( events ) . toEqual ( [ operation ] ) ;
40094009 expect ( prepared ) . toMatchObject ( { branch : "feature/pr-safe" , isOnPullRequestHead : true } ) ;
40104010 expect ( ( yield * runGit ( repoDir , [ "rev-parse" , "main" ] ) ) . stdout . trim ( ) ) . toBe ( mainCommit ) ;
4011- expect ( ( yield * runGit ( repoDir , [ "rev-parse" , "feature/pr-safe" ] ) ) . stdout . trim ( ) ) . toBe (
4012- pullHead ,
4013- ) ;
4011+ const pullBranch = operation === "commit" ? "feature/pr-safe^" : "feature/pr-safe" ;
4012+ expect ( ( yield * runGit ( repoDir , [ "rev-parse" , pullBranch ] ) ) . stdout . trim ( ) ) . toBe ( pullHead ) ;
40144013 expect ( ( yield * runGit ( repoDir , [ "branch" , "--show-current" ] ) ) . stdout . trim ( ) ) . toBe (
40154014 operation === "switch"
40164015 ? "main"
4017- : "branch" in switched
4018- ? switched . branch . name
4019- : "second-client" ,
4016+ : operation === "commit"
4017+ ? "feature/pr-safe"
4018+ : "branch" in switched
4019+ ? switched . branch . name
4020+ : "second-client" ,
40204021 ) ;
40214022 if ( "commit" in switched ) {
40224023 expect ( switched . commit . status ) . toBe ( "created" ) ;
0 commit comments