@@ -572,7 +572,7 @@ describe("--verbose", () => {
572572// ── diverged commit matching in plan ─────────────────────────────
573573
574574describe ( "diverged commit matching in plan" , ( ) => {
575- test ( "arb rebase --verbose --dry-run skips cherry-picked commit (detected as squash-merged)" , ( ) =>
575+ test ( "arb rebase --verbose --dry-run plans reset for cherry-picked commit (detected as squash-merged)" , ( ) =>
576576 withEnv ( async ( env ) => {
577577 await arb ( env , [ "create" , "my-feature" , "repo-a" ] ) ;
578578 await write ( join ( env . projectDir , "my-feature/repo-a/feature.txt" ) , "feature" ) ;
@@ -594,10 +594,11 @@ describe("diverged commit matching in plan", () => {
594594 cwd : join ( env . projectDir , "my-feature" ) ,
595595 } ) ;
596596 expect ( result . exitCode ) . toBe ( 0 ) ;
597- expect ( result . output ) . toContain ( "already squash-merged into main" ) ;
597+ expect ( result . output ) . toContain ( "reset to origin/main" ) ;
598+ expect ( result . output ) . toContain ( "merged" ) ;
598599 } ) ) ;
599600
600- test ( "arb rebase skips repo that was squash-merged onto base" , ( ) =>
601+ test ( "arb rebase plans reset for repo that was squash-merged onto base" , ( ) =>
601602 withEnv ( async ( env ) => {
602603 await arb ( env , [ "create" , "my-feature" , "repo-a" ] ) ;
603604 await write ( join ( env . projectDir , "my-feature/repo-a/first.txt" ) , "first" ) ;
@@ -619,10 +620,11 @@ describe("diverged commit matching in plan", () => {
619620 cwd : join ( env . projectDir , "my-feature" ) ,
620621 } ) ;
621622 expect ( result . exitCode ) . toBe ( 0 ) ;
622- expect ( result . output ) . toContain ( "already squash-merged into main" ) ;
623+ expect ( result . output ) . toContain ( "reset to origin/main" ) ;
624+ expect ( result . output ) . toContain ( "commits merged" ) ;
623625 } ) ) ;
624626
625- test ( "arb rebase skips squash-merged repo and rebases others" , ( ) =>
627+ test ( "arb rebase resets squash-merged repo and rebases others" , ( ) =>
626628 withEnv ( async ( env ) => {
627629 await arb ( env , [ "create" , "my-feature" , "repo-a" , "repo-b" ] ) ;
628630
@@ -650,12 +652,16 @@ describe("diverged commit matching in plan", () => {
650652 cwd : join ( env . projectDir , "my-feature" ) ,
651653 } ) ;
652654 expect ( result . exitCode ) . toBe ( 0 ) ;
653- expect ( result . output ) . toContain ( "already squash-merged into main" ) ;
655+ expect ( result . output ) . toContain ( "reset to origin/ main (merged) " ) ;
654656 expect ( result . output ) . toContain ( "rebased my-feature onto origin/main" ) ;
655657
656658 // Verify repo-b actually has the upstream commit after rebase
657659 const logB = await git ( join ( env . projectDir , "my-feature/repo-b" ) , [ "log" , "--oneline" ] ) ;
658660 expect ( logB ) . toContain ( "upstream change" ) ;
661+
662+ // Verify repo-a was reset to origin/main (squash commit is in history)
663+ const logA = await git ( join ( env . projectDir , "my-feature/repo-a" ) , [ "log" , "--oneline" ] ) ;
664+ expect ( logA ) . toContain ( "squash: feature" ) ;
659665 } ) ) ;
660666
661667 test ( "arb rebase --verbose --dry-run shows no match annotations for genuinely different commits" , ( ) =>
0 commit comments